@@ -2,84 +2,90 @@ name: CI Pipeline
2
2
3
3
on :
4
4
push :
5
+ pull_request :
5
6
6
7
env :
7
8
NODE_VERSION : ' 18'
8
- PNPM_VERSION : ' 10 '
9
+ PNPM_VERSION : ' 8 ' # Using stable version
9
10
10
11
jobs :
11
- lint :
12
- name : Lint
12
+ build :
13
+ name : Build
13
14
runs-on : ubuntu-latest
14
15
steps :
15
16
- uses : actions/checkout@v4
16
17
17
- # Setup Node.js with pnpm cache
18
+ - name : Install pnpm
19
+ uses : pnpm/action-setup@v4
20
+ with :
21
+ version : ${{ env.PNPM_VERSION }}
22
+ run_install : false
23
+
18
24
- name : Setup Node.js
19
25
uses : actions/setup-node@v4
20
26
with :
21
27
node-version : ${{ env.NODE_VERSION }}
22
28
cache : ' pnpm'
23
29
24
- # Install pnpm explicitly
30
+ - run : pnpm install --frozen-lockfile
31
+ - run : pnpm build
32
+ - uses : actions/upload-artifact@v3
33
+ with :
34
+ name : build-artifacts
35
+ path : dist/
36
+
37
+ lint :
38
+ name : Lint
39
+ needs : [build]
40
+ runs-on : ubuntu-latest
41
+ steps :
42
+ - uses : actions/checkout@v4
43
+
44
+ # First install pnpm globally
25
45
- name : Install pnpm
26
46
uses : pnpm/action-setup@v4
27
47
with :
28
48
version : ${{ env.PNPM_VERSION }}
49
+ run_install : false
29
50
30
- # Verify pnpm is available
31
- - name : Check pnpm version
32
- run : pnpm --version
51
+ # Then setup Node.js with pnpm cache
52
+ - name : Setup Node.js
53
+ uses : actions/setup-node@v4
54
+ with :
55
+ node-version : ${{ env.NODE_VERSION }}
56
+ cache : ' pnpm'
57
+
58
+ # Verify installations
59
+ - name : Check versions
60
+ run : |
61
+ node --version
62
+ pnpm --version
33
63
34
64
- run : pnpm install --frozen-lockfile
35
65
- run : pnpm lint
36
66
37
67
test :
38
68
name : Test with Coverage
69
+ needs : [build]
39
70
runs-on : ubuntu-latest
40
71
steps :
41
72
- uses : actions/checkout@v4
42
73
43
- - name : Setup Node.js
44
- uses : actions/setup-node@v4
45
- with :
46
- node-version : ${{ env.NODE_VERSION }}
47
- cache : ' pnpm'
48
-
49
74
- name : Install pnpm
50
75
uses : pnpm/action-setup@v4
51
76
with :
52
77
version : ${{ env.PNPM_VERSION }}
53
-
54
- - run : pnpm install --frozen-lockfile
55
- - run : pnpm test:coverage
56
-
57
- - name : Upload coverage to Codecov
58
- uses : codecov/codecov-action@v5
59
- with :
60
- token : ${{ secrets.CODECOV_TOKEN }}
61
-
62
- build :
63
- name : Build
64
- needs : [lint, test]
65
- runs-on : ubuntu-latest
66
- steps :
67
- - uses : actions/checkout@v4
78
+ run_install : false
68
79
69
80
- name : Setup Node.js
70
81
uses : actions/setup-node@v4
71
82
with :
72
83
node-version : ${{ env.NODE_VERSION }}
73
84
cache : ' pnpm'
74
85
75
- - name : Install pnpm
76
- uses : pnpm/action-setup@v4
77
- with :
78
- version : ${{ env.PNPM_VERSION }}
79
-
80
86
- run : pnpm install --frozen-lockfile
81
- - run : pnpm build
82
- - uses : actions/upload-artifact@v3
87
+ - run : pnpm test:coverage
88
+ - name : Upload coverage to Codecov
89
+ uses : codecov/codecov-action@v5
83
90
with :
84
- name : build-artifacts
85
- path : dist/
91
+ token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments