Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/tests-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,31 @@ jobs:
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

# Caches saved on PR branches are not restorable from other PRs, so this job
# keeps a fresh default-branch Nx cache that the graphql-codegen PR check can
# restore. It must run on macOS to match that check's runner (the generated
# output is platform-specific).
warm-graphql-codegen-cache:
name: 'Warm graphql-codegen Nx cache'
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Setup deps
uses: ./.github/actions/setup-cli-deps
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}
- name: Restore Nx cache
uses: actions/cache@v4
with:
path: .nx/cache
key: nx-graphql-codegen-${{ runner.os }}-${{ github.sha }}
restore-keys: |
nx-graphql-codegen-${{ runner.os }}-
- name: Get schemas for codegen
run: pnpm graphql-codegen:get-graphql-schemas
- name: Run graphql-codegen
run: pnpm graphql-codegen
11 changes: 11 additions & 0 deletions .github/workflows/tests-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ jobs:
uses: ./.github/actions/setup-cli-deps
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}
# The key never matches directly (it includes the sha), so every run
# restores the newest cache via restore-keys and saves an updated one.
# Nx hashes the downloaded schemas and .graphql documents, so stale
# entries are recomputed, never replayed.
- name: Restore Nx cache
uses: actions/cache@v4
with:
path: .nx/cache
key: nx-graphql-codegen-${{ runner.os }}-${{ github.sha }}
restore-keys: |
nx-graphql-codegen-${{ runner.os }}-
- name: Get schemas for codegen
run: pnpm graphql-codegen:get-graphql-schemas
- name: Run graphql-codegen
Expand Down
Loading