name: Testing on: push: branches: - master pull_request: branches: - master concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: NODE_OPTIONS: '--max_old_space_size=4096' jobs: lint: name: Linting Check uses: the-guild-org/shared-config/.github/workflows/lint.yml@1c4632ccc198d4c9b34d9e6b3d556c6f245b4e69 # main with: script: pnpm lint:ci packageManager: pnpm secrets: githubToken: ${{ secrets.GITHUB_TOKEN }} prettier-check: name: ๐Ÿงน Prettier Check runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 - name: Install pnpm uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: standalone: true cache: true - name: Install Node uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 24 - name: Install packages run: pnpm install - name: Prettier Check run: pnpm prettier:check types-check: name: ๐Ÿ”Ž Types Check runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 - name: Install pnpm uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: standalone: true cache: true - name: Install Node uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 24 - name: Install packages run: pnpm install - name: Types Check run: pnpm types:check config-docs-check: name: ๐Ÿ“– Config Docs Check runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 # Installs pnpm (version from packageManager) and Node, then runs `pnpm install`. - name: Install pnpm, Node and packages uses: pnpm/setup@731dfb6463bbd11c11fd0ee11fe00ed0e36d48a1 # v3.2.0 with: runtime: node@24 cache: true - name: Config examples cover every option and match plugin output run: pnpm vitest run packages/utils/config-examples - name: Config docs schema is up to date # The docs render each plugin's Config API Reference from this file. Regenerate it with # `pnpm --filter website generate-config-schema` (see agents/config-options.md). run: | pnpm --filter website generate-config-schema git diff --exit-code -- website/config.schema.json dev-tests: name: Validating dev-tests runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] method: - 'cjs' - 'esm' steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 - name: Install pnpm uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: standalone: true cache: true - name: Install Node uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 24 - name: Install packages run: pnpm install - name: Build run: pnpm build env: CI: true - name: Test dev-tests ${{matrix.method}} # windows-latest defaults multi-line `run:` blocks to pwsh, which does not # stop the script when an earlier command exits non-zero (unlike bash's # default -e). That silently turned a failing `generate:esm` into a green # step here, because `git diff` then found nothing to report. Forcing bash # (bundled via Git for Windows) makes this fail the way it does on Linux. shell: bash run: | pnpm run dev-test:generate:${{matrix.method}} git diff --exit-code -- dev-test/ examples-tests: name: Examples - Normal runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 - name: Install pnpm uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: standalone: true cache: true - name: Install Node uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 24 - name: Install packages # `side-effects-cache false` is set to avoid using pnpm cache for binary cache like Cypress' run: | pnpm config set side-effects-cache false --location project pnpm i - name: Build run: pnpm build env: CI: true - name: Generate and Diff Codegen Artifacts run: | pnpm examples:codegen git diff --exit-code -- examples/ - name: Build Examples run: | pnpm examples:build - name: End2End Test Examples run: | pnpm examples:test:end2end esm: name: Testing exports integrity runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 - name: Install pnpm uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: standalone: true cache: true - name: Install Node uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 24 - name: Install packages run: pnpm i - name: Build run: pnpm build env: CI: true - name: Test ESM & CJS integrity run: pnpm bob check test: name: Unit Test on Node ${{matrix.node_version}} (${{matrix.os}}) and GraphQL v${{matrix.graphql_version}} runs-on: ${{ matrix.os }} needs: - lint - prettier-check - esm strategy: matrix: os: [ubuntu-latest] # remove windows to speed up the tests node_version: [22, 24] graphql_version: [16, 17] include: - node_version: 22 os: windows-latest graphql_version: 16 steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 - name: Install pnpm uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: standalone: true cache: true - name: Install Node uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: ${{matrix.node_version}} - name: Install Dependencies to match graphql version run: pnpm i - name: Use GraphQL v${{matrix.graphql_version}} run: node ./scripts/match-graphql.js ${{matrix.graphql_version}} - name: Install Dependencies run: pnpm i --no-frozen-lockfile # no frozen-lockfile because `graphql` version is changed - name: Build run: pnpm build - name: Test run: pnpm test env: CI: true