Skip to content

Commit 87c0a6e

Browse files
Split up CI jobs, add caching
1 parent 11044a3 commit 87c0a6e

File tree

1 file changed

+64
-3
lines changed

1 file changed

+64
-3
lines changed

.github/workflows/ci.yml

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,81 @@ on:
55
pull_request:
66
branches: [main]
77
jobs:
8-
test:
9-
timeout-minutes: 60
8+
lint:
9+
timeout-minutes: 10
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v4
1313
- uses: actions/setup-node@v4
1414
with:
1515
node-version: 22
16+
- uses: pnpm/action-setup@v4
17+
with:
18+
version: 10
19+
- name: Get pnpm store directory
20+
shell: bash
21+
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
22+
- uses: actions/cache@v4
23+
name: Setup pnpm cache
24+
with:
25+
path: ${{ env.STORE_PATH }}
26+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
27+
restore-keys: |
28+
${{ runner.os }}-pnpm-store-
1629
- name: Install dependencies
17-
run: npm install -g pnpm && pnpm install
30+
run: pnpm install
1831
- name: Run linting
1932
run: pnpm lint
33+
34+
unit:
35+
timeout-minutes: 10
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: actions/setup-node@v4
40+
with:
41+
node-version: 22
42+
- uses: pnpm/action-setup@v4
43+
with:
44+
version: 10
45+
- name: Get pnpm store directory
46+
shell: bash
47+
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
48+
- uses: actions/cache@v4
49+
name: Setup pnpm cache
50+
with:
51+
path: ${{ env.STORE_PATH }}
52+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
53+
restore-keys: |
54+
${{ runner.os }}-pnpm-store-
55+
- name: Install dependencies
56+
run: pnpm install
2057
- name: Run unit tests
2158
run: pnpm test:unit run
59+
60+
e2e:
61+
timeout-minutes: 60
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@v4
65+
- uses: actions/setup-node@v4
66+
with:
67+
node-version: 22
68+
- uses: pnpm/action-setup@v4
69+
with:
70+
version: 10
71+
- name: Get pnpm store directory
72+
shell: bash
73+
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
74+
- uses: actions/cache@v4
75+
name: Setup pnpm cache
76+
with:
77+
path: ${{ env.STORE_PATH }}
78+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
79+
restore-keys: |
80+
${{ runner.os }}-pnpm-store-
81+
- name: Install dependencies
82+
run: pnpm install
2283
- name: Install Playwright Browsers
2384
run: pnpm exec playwright install --with-deps
2485
- name: Run Playwright tests

0 commit comments

Comments
 (0)