Skip to content

Commit b1d1945

Browse files
committed
DO-1082: Split PR workflow into separate install, lint, build, and test jobs
1 parent 213e50e commit b1d1945

File tree

1 file changed

+58
-2
lines changed

1 file changed

+58
-2
lines changed

.github/workflows/pull-request.yml

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,66 @@ jobs:
2424
exit 1
2525
fi
2626
27+
install:
28+
name: 📦 Install dependencies
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout Repository
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
36+
- name: Fetch target
37+
run: git fetch origin ${{ env.PR_BASE_REF }}
38+
39+
- name: Enable Corepack
40+
run: corepack enable
41+
42+
- uses: actions/setup-node@v4
43+
with:
44+
node-version-file: ".nvmrc"
45+
cache: "yarn"
46+
47+
- name: Install
48+
run: yarn install --frozen-lockfile
49+
50+
env:
51+
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
52+
53+
lint:
54+
name: 🔍 Lint affected packages
55+
runs-on: ubuntu-latest
56+
needs: install
57+
steps:
58+
- name: Checkout Repository
59+
uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 0
62+
63+
- name: Fetch target
64+
run: git fetch origin ${{ env.PR_BASE_REF }}
65+
66+
- name: Enable Corepack
67+
run: corepack enable
68+
69+
- uses: actions/setup-node@v4
70+
with:
71+
node-version-file: ".nvmrc"
72+
cache: "yarn"
73+
74+
- name: Install
75+
run: yarn install --frozen-lockfile
76+
77+
- name: Lint affected packages
78+
run: yarn nx affected:lint --base=origin/${{ env.PR_BASE_REF }} --parallel --max-parallel=3
79+
80+
env:
81+
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
82+
2783
build:
2884
name: 🏭 Build all packages
2985
runs-on: ubuntu-latest
86+
needs: install
3087
steps:
3188
- name: Checkout Repository
3289
uses: actions/checkout@v4
@@ -50,14 +107,13 @@ jobs:
50107
- name: Build all packages
51108
run: yarn nx run-many -t build
52109

53-
- run: yarn nx affected:lint --base=origin/${{ env.PR_BASE_REF }} --parallel --max-parallel=3
54-
55110
env:
56111
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
57112

58113
test:
59114
name: 🧪 Run tests
60115
runs-on: ubuntu-latest
116+
needs: install
61117
steps:
62118
- name: Checkout Repository
63119
uses: actions/checkout@v4

0 commit comments

Comments
 (0)