chore: add WordPress 6.9 to test matrix #599
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Schema Linter | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| - main | |
| pull_request: | |
| branches: | |
| - develop | |
| - main | |
| jobs: | |
| run: | |
| runs-on: ubuntu-22.04 | |
| name: Lint WPGraphQL Schema | |
| if: contains(github.event.pull_request.labels.*.name, 'safe to test ✔') || github.repository == github.event.repository.full_name || github.event_name == 'push' | |
| services: | |
| mariadb: | |
| image: mariadb:10.8.2 | |
| ports: | |
| - 3306:3306 | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| # Ensure docker waits for mariadb to start | |
| 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@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Setup WordPress | |
| uses: ./.github/actions/setup-wordpress | |
| with: | |
| wp-version: '6.9' | |
| - name: Setup GraphQL Schema Linter | |
| run: npm install -g graphql-schema-linter@^3.0 graphql@^16 | |
| - name: Generate the Static Schema | |
| run: | | |
| cd /tmp/wordpress/ | |
| # Output: /tmp/schema.graphql | |
| wp graphql generate-static-schema | |
| - name: Lint the Static Schema | |
| run: | | |
| graphql-schema-linter --except=relay-connection-types-spec,relay-page-info-spec /tmp/schema.graphql | |
| - name: Display ignored linting errors | |
| run: | | |
| graphql-schema-linter /tmp/schema.graphql || true | |
| - name: Get Latest tag | |
| uses: actions-ecosystem/action-get-latest-tag@v1 | |
| id: get-latest-tag | |
| - name: Test Schema for breaking changes | |
| run: | | |
| echo "Previous tagged schema ${{ steps.get-latest-tag.outputs.tag }}" | |
| - name: Get Previous Released Schema | |
| run: curl 'https://github.com/wpengine/wp-graphql-content-blocks/releases/download/${{ steps.get-latest-tag.outputs.tag }}/schema.graphql' -L --output /tmp/${{ steps.get-latest-tag.outputs.tag }}.graphql | |
| # https://github.com/marketplace/actions/graphql-inspector | |
| - name: Install Schema Inspector | |
| run: | | |
| npm install @graphql-inspector/config @graphql-inspector/cli graphql | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: schema.graphql | |
| path: /tmp/schema.graphql | |
| # Schema changes between WordPress versions are expected and not regressions in this plugin. | |
| # The inspector runs to document changes for release notes, but doesn't block CI. | |
| # Update wp-version above when releasing a new version with updated "Tested up to:" header. | |
| - name: Run Schema Inspector | |
| continue-on-error: true | |
| run: | | |
| # This schema and previous release schema | |
| node_modules/.bin/graphql-inspector diff /tmp/${{ steps.get-latest-tag.outputs.tag }}.graphql /tmp/schema.graphql |