Skip to content

Commit 933af1b

Browse files
committed
Revert "Try to improve caching"
This reverts commit 63d0abd.
1 parent 63d0abd commit 933af1b

File tree

1 file changed

+33
-28
lines changed

1 file changed

+33
-28
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,28 @@ on:
1111
- 'LICENSE.txt'
1212

1313
jobs:
14-
# Build job - includes dependency installation and builds everything
14+
# Fast job to install dependencies and cache them for other jobs
15+
setup:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
cache-key: ${{ steps.cache-key.outputs.key }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Generate cache key
22+
id: cache-key
23+
run: echo "key=node-modules-${{ hashFiles('**/yarn.lock') }}" >> $GITHUB_OUTPUT
24+
- name: Use Node.js 20.x
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 20.x
28+
cache: 'yarn'
29+
- name: Install Dependencies
30+
run: yarn install --frozen-lockfile
31+
32+
# Build job - runs in parallel with lint and test jobs
1533
build:
1634
runs-on: ubuntu-latest
35+
needs: setup
1736
steps:
1837
- uses: actions/checkout@v4
1938
- name: Use Node.js 20.x
@@ -38,54 +57,39 @@ jobs:
3857
path: |
3958
packages/*/built
4059
packages/*/dist
41-
node_modules
42-
key: build-cache-${{ github.sha }}-${{ hashFiles('**/yarn.lock') }}
60+
key: build-artifacts-${{ github.sha }}
4361

44-
# Lint job - reuses dependencies from build job
62+
# Lint job - runs in parallel
4563
lint:
4664
runs-on: ubuntu-latest
47-
needs: build
65+
needs: setup
4866
steps:
4967
- uses: actions/checkout@v4
5068
- name: Use Node.js 20.x
5169
uses: actions/setup-node@v4
5270
with:
5371
node-version: 20.x
5472
cache: 'yarn'
55-
- name: Restore dependencies and build cache
56-
uses: actions/cache@v4
57-
with:
58-
path: |
59-
packages/*/built
60-
packages/*/dist
61-
node_modules
62-
key: build-cache-${{ github.sha }}-${{ hashFiles('**/yarn.lock') }}
63-
fail-on-cache-miss: true
73+
- name: Install Dependencies
74+
run: yarn install --frozen-lockfile
6475
- name: Lint
6576
run: |
6677
yarn lint
6778
yarn workspace webamp type-check
6879
69-
# Test job - reuses dependencies from build job
80+
# Test job - runs in parallel
7081
test:
7182
runs-on: ubuntu-latest
72-
needs: build
83+
needs: setup
7384
steps:
7485
- uses: actions/checkout@v4
7586
- name: Use Node.js 20.x
7687
uses: actions/setup-node@v4
7788
with:
7889
node-version: 20.x
7990
cache: 'yarn'
80-
- name: Restore dependencies and build cache
81-
uses: actions/cache@v4
82-
with:
83-
path: |
84-
packages/*/built
85-
packages/*/dist
86-
node_modules
87-
key: build-cache-${{ github.sha }}-${{ hashFiles('**/yarn.lock') }}
88-
fail-on-cache-miss: true
91+
- name: Install Dependencies
92+
run: yarn install --frozen-lockfile
8993
- name: Run Unit Tests
9094
run: |
9195
touch packages/skin-database/config.js
@@ -127,14 +131,15 @@ jobs:
127131
node-version: 20.x
128132
registry-url: https://registry.npmjs.org/
129133
cache: 'yarn'
130-
- name: Restore dependencies and build cache
134+
- name: Install dependencies
135+
run: yarn install --frozen-lockfile
136+
- name: Restore build artifacts
131137
uses: actions/cache@v4
132138
with:
133139
path: |
134140
packages/*/built
135141
packages/*/dist
136-
node_modules
137-
key: build-cache-${{ github.sha }}-${{ hashFiles('**/yarn.lock') }}
142+
key: build-artifacts-${{ github.sha }}
138143
fail-on-cache-miss: true
139144
- name: Set version
140145
if: github.ref == 'refs/heads/master'

0 commit comments

Comments
 (0)