Skip to content

Commit 0f2e0bd

Browse files
committed
ci(workflow): better pr performance
1 parent 7065fe3 commit 0f2e0bd

2 files changed

Lines changed: 26 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ on:
66
- opened
77
- reopened
88
- synchronize
9+
paths-ignore:
10+
- "**/*.md"
11+
- ".github/ISSUE_TEMPLATE/**"
12+
- ".github/PULL_REQUEST_TEMPLATE/**"
13+
- ".github/CODEOWNERS"
14+
- "LICENSE"
15+
- "libs/shared/util/seed/src/lib/static-data/media/**"
916
merge_group:
1017
push:
1118
branches:
@@ -22,7 +29,9 @@ permissions:
2229
env:
2330
CDWR_DEBUG_LOGGING: true
2431
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
25-
NX_NO_CLOUD: ${{ startsWith(github.head_ref || github.ref_name, 'renovate') || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || vars.NX_NO_CLOUD }}
32+
NX_NO_CLOUD: ${{ startsWith(github.head_ref || github.ref_name, 'renovate') ||
33+
github.event_name == 'push' || github.event_name == 'workflow_dispatch' ||
34+
vars.NX_NO_CLOUD }}
2635
NX_PARALLEL: ${{ vars.NX_PARALLEL }}
2736
NX_VERBOSE_LOGGING: ${{ vars.NX_VERBOSE_LOGGING }}
2837

@@ -49,10 +58,13 @@ jobs:
4958
- name: Install dependencies
5059
run: pnpm install --frozen-lockfile
5160

61+
# Not needed in the merge queue — E2E and integration tests are skipped there
5262
- name: Install playwright browsers
63+
if: github.event_name != 'merge_group'
5364
run: pnpm exec playwright install --with-deps
5465

5566
- name: Install Fly CLI
67+
if: github.event_name != 'merge_group'
5668
uses: superfly/flyctl-actions/setup-flyctl@master
5769
with:
5870
version: ${{ vars.FLY_CLI_VERSION }}
@@ -70,10 +82,17 @@ jobs:
7082

7183
- run: pnpm nx affected -t lint,test,build -c ci
7284

73-
# nx-payload-e2e only runs in e2e-matrix workflow
74-
- run: pnpm nx affected -t e2e -c ci --exclude nx-payload-e2e
85+
# E2E, integration, and smoke tests are skipped in the merge queue — they were
86+
# already verified in the PR. The merge queue only needs lint/test/build.
7587

76-
- run: pnpm nx affected -t integration-test -c ci
88+
# nx-payload-e2e runs separately in the e2e-matrix workflow
89+
- name: E2E tests
90+
if: github.event_name != 'merge_group'
91+
run: pnpm nx affected -t e2e -c ci --exclude nx-payload-e2e
92+
93+
- name: Integration tests
94+
if: github.event_name != 'merge_group'
95+
run: pnpm nx affected -t integration-test -c ci
7796
env:
7897
FLY_TEST_API_TOKEN: ${{ secrets.FLY_TEST_API_TOKEN }}
7998
FLY_TEST_ORG: ${{ vars.FLY_TEST_ORG }}
@@ -83,6 +102,7 @@ jobs:
83102
INFISICAL_TEST_SITE: ${{ vars.INFISICAL_SITE }}
84103

85104
- name: Linux nx-payload e2e smoke (pnpm)
105+
if: github.event_name != 'merge_group'
86106
run: pnpm nx affected -t e2e --exclude '*,!tag:scope:nx-payload-e2e' -c quick
87107
env:
88108
CDWR_E2E_PACKAGE_MANAGER: pnpm

.github/workflows/e2e-matrix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ jobs:
156156
with:
157157
lookup-only: true
158158
path: "**/node_modules"
159-
key: ${{ matrix.os }}-modules-${{ matrix.node }}-${{ github.run_id }}
159+
key: ${{ matrix.os }}-modules-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}
160160

161161
- if: steps.cache-modules.outputs.cache-hit != 'true'
162162
run: pnpm install --frozen-lockfile
@@ -235,7 +235,7 @@ jobs:
235235
id: cache-modules
236236
with:
237237
path: "**/node_modules"
238-
key: ${{ matrix.os }}-modules-${{ matrix.node }}-${{ github.run_id }}
238+
key: ${{ matrix.os }}-modules-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}
239239

240240
- name: Install dependencies
241241
run: pnpm install --frozen-lockfile

0 commit comments

Comments
 (0)