11name : CI
2-
32on :
43 push :
54 branches :
@@ -17,55 +16,42 @@ jobs:
1716 runs-on : ubuntu-latest
1817 steps :
1918 - name : Checkout code
20- uses : actions/checkout@v6.0.2
21-
22- - name : Detect package manager
23- id : detect
24- run : |
25- if [ -f "yarn.lock" ]; then
26- echo "manager=yarn" >> $GITHUB_OUTPUT
27- elif [ -f "pnpm-lock.yaml" ]; then
28- echo "manager=pnpm" >> $GITHUB_OUTPUT
29- elif [ -f "package-lock.json" ]; then
30- echo "manager=npm" >> $GITHUB_OUTPUT
31- else
32- echo "manager=none" >> $GITHUB_OUTPUT
33- fi
34-
19+ uses : actions/checkout@v4
3520 - name : Validate package manager
3621 run : |
37- if [ "${{ steps.detect.outputs.manager }}" != "pnpm " ]; then
38- echo "Expected pnpm but found: ${{ steps.detect.outputs.manager }} "
39- echo "Please use pnpm for this project (pnpm-lock.yaml not found) "
22+ if [ ! -f "yarn.lock " ]; then
23+ echo "Expected yarn.lock but it was not found. "
24+ echo "Please use Yarn v4 (Berry) for this project. "
4025 exit 1
4126 fi
27+ echo "yarn.lock found — package manager check passed."
4228
4329 test-and-build :
4430 runs-on : ubuntu-latest
45-
4631 steps :
4732 - name : Checkout repository
48- uses : actions/checkout@v6.0.2
49-
50- - name : Setup pnpm
51- uses : pnpm/action-setup@v4.2.0
52- with :
53- version : 9
54-
33+ uses : actions/checkout@v4
5534 - name : Setup Node.js
56- uses : actions/setup-node@v6.2.0
35+ uses : actions/setup-node@v4
5736 with :
5837 node-version : 24
59- cache : ' pnpm'
60-
38+ - name : Enable Corepack
39+ run : corepack enable
40+ - name : Get Yarn cache directory
41+ id : yarn-cache-dir
42+ run : echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
43+ - name : Cache Yarn dependencies
44+ uses : actions/cache@v4
45+ with :
46+ path : ${{ steps.yarn-cache-dir.outputs.dir }}
47+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
48+ restore-keys : |
49+ ${{ runner.os }}-yarn-
6150 - name : Install dependencies
62- run : pnpm install --frozen-lockfile
63-
51+ run : yarn install --immutable
6452 - name : Lint
65- run : pnpm lint
66-
53+ run : yarn lint
6754 - name : Build
68- run : pnpm build
69-
55+ run : yarn build
7056 - name : Test
71- run : pnpm test
57+ run : yarn test
0 commit comments