Skip to content

Commit

Permalink
ci: update github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
justlevine committed Apr 6, 2024
1 parent 6b1674e commit 7799116
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 30 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,22 @@ on:
- main
types: [ opened, synchronize, reopened, labeled ]


# Cancel previous workflow run groups that have not completed.
concurrency:
# Group workflow runs by workflow name, along with the head branch ref of the pull request
# or otherwise the branch or tag ref.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
run:
runs-on: ubuntu-latest
name: Check code
if: contains(github.event.pull_request.labels.*.name, 'safe to test ✔') || ( github.event_name == 'push' && ( github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' ) )
services:
mariadb:
image: mariadb
image: mariadb:10
ports:
- 3306:3306
env:
Expand All @@ -27,12 +35,9 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request' }}
uses: styfle/[email protected]

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

Expand All @@ -45,7 +50,7 @@ jobs:
tools: composer:v2, wp-cli

- name: Install dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
composer-options: "--no-progress"

Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/code-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@ on:
- develop
- main

# Cancel previous workflow run groups that have not completed.
concurrency:
# Group workflow runs by workflow name, along with the head branch ref of the pull request
# or otherwise the branch or tag ref.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
run:
runs-on: ubuntu-latest
name: Checkout repo
steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request' }}
uses: styfle/[email protected]

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -31,7 +35,7 @@ jobs:
coverage: none

- name: Install dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
composer-options: "--no-progress"

Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/integration-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ on:
- "!docs/**"
types: [ opened, synchronize, reopened, labeled ]

# Cancel previous workflow run groups that have not completed.
concurrency:
# Group workflow runs by workflow name, along with the head branch ref of the pull request
# or otherwise the branch or tag ref.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
continuous_integration:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -47,12 +54,8 @@ jobs:
fail-fast: false

steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request_target' }}
uses: styfle/[email protected]

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

Expand All @@ -64,7 +67,7 @@ jobs:
tools: composer:v2

- name: Install dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3

- name: Build "testing" Docker Image
env:
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/schema-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ on:
- main
types: [ opened, synchronize, reopened, labeled ]

# Cancel previous workflow run groups that have not completed.
concurrency:
# Group workflow runs by workflow name, along with the head branch ref of the pull request
# or otherwise the branch or tag ref.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
cancel-in-progress: true


jobs:
run:
runs-on: ubuntu-latest
Expand All @@ -19,7 +27,7 @@ jobs:

services:
mariadb:
image: mariadb
image: mariadb:10
ports:
- 3306:3306
env:
Expand All @@ -28,12 +36,9 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request_target' }}
uses: styfle/[email protected]

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

Expand All @@ -46,13 +51,18 @@ jobs:
tools: composer:v2, wp-cli

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20.x

- name: Setup GraphQL Schema Linter
run: npm install -g graphql-schema-linter@^3.0 graphql@^16

- name: Install dependencies
uses: ramsey/composer-install@v3
with:
composer-options: "--no-progress"

- name: Setup WordPress
run: |
cp .env.dist .env
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/upload-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -27,13 +28,15 @@ jobs:
run: |
mkdir plugin-build
composer archive -vvv --format=zip --file="plugin-build/wp-graphql-facetwp"
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wp-graphql-facetwp
path: plugin-build/wp-graphql-facetwp.zip

- name: Upload release asset
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: plugin-build/wp-graphql-facetwp.zip
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/upload-schema-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

services:
mariadb:
image: mariadb
image: mariadb:10
ports:
- 3306:3306
env:
Expand All @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP w/ Composer & WP-CLI
uses: shivammathur/setup-php@v2
Expand All @@ -44,7 +44,7 @@ jobs:
wp graphql generate-static-schema
- name: Upload schema as release artifact
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: /tmp/schema.graphql
env:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

ci: update GitHub Workflows.

## v0.4.4

This _minor_ release implements the new WPGraphQL Coding Standards ruleset for `PHP_CodeSniffer`. While many of the addressed sniffs are cosmetic, numerous smells regarding performance, type safety, sanitization, and 3rd-party interoperability have been fixed as well.
Expand Down

0 comments on commit 7799116

Please sign in to comment.