@@ -13,17 +13,30 @@ concurrency:
1313 cancel-in-progress : ${{ github.ref_name != 'main' }}
1414
1515env :
16- 17- NODE_VERSION : 20 # needs to be in sync with other versions below
1816 DEFAULT_BRANCH : ${{ github.event.repository.default_branch }}
1917 DRY_RUN : true
2018
2119permissions :
2220 contents : read
2321
2422jobs :
23+ prepare :
24+ runs-on : ubuntu-latest
25+ timeout-minutes : 10
26+
27+ steps :
28+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+ with :
30+ show-progress : false
31+
32+ - name : 📥 Setup Node.js
33+ uses : ./.github/actions/setup-node
34+ with :
35+ save-cache : true
2536 test :
26- name : ${{ matrix.node-version == 20 && format('test ({0})', matrix.os) || format('test ({0}, node-{1})', matrix.os, matrix.node-version) }}
37+ needs :
38+ - prepare
39+ name : ${{ matrix.node-version == 22 && format('test ({0})', matrix.os) || format('test ({0}, node-{1})', matrix.os, matrix.node-version) }}
2740 runs-on : ${{ matrix.os }}
2841
2942 # tests shouldn't need more time
@@ -32,41 +45,32 @@ jobs:
3245 strategy :
3346 matrix :
3447 os : [ubuntu-latest, macos-latest, windows-latest]
35- node-version : [18, 20]
48+ node-version : [18, 20, 22 ]
3649
3750 env :
38- coverage : ${{ matrix.os == 'ubuntu-latest' && matrix.node-version == 20 }}
39- NODE_VERSION : ${{ matrix.node-version }}
51+ coverage : ${{ matrix.os == 'ubuntu-latest' && matrix.node-version == 22 }}
4052
4153 steps :
4254 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4355 with :
44- fetch-depth : 2
56+ fetch-depth : 10 # required for coverage
4557 show-progress : false
4658 filter : blob:none # we don't need all blobs
4759
48- - name : Enable corepack
49- run : corepack enable
50-
51- - name : Set up Node.js ${{ env.NODE_VERSION }}
52- uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
60+ - name : 📥 Setup Node.js
61+ uses : ./.github/actions/setup-node
5362 with :
54- node-version : ${{ env.NODE_VERSION }}
55- cache : pnpm
63+ node-version : ${{ matrix.node-version }}
64+ save- cache : true
5665
5766 - name : Init platform
5867 shell : bash
5968 run : |
6069 git config --global core.autocrlf false
6170 git config --global core.symlinks true
62- git config --global user.email ${GIT_EMAIL}
63- git config --global user.name 'Renovate Bot'
6471 echo "Node $(node --version)"
6572 echo "pnpm $(pnpm --version)"
6673
67- - name : Installing dependencies
68- run : pnpm install
69-
7074 - name : Build
7175 run : pnpm build
7276
8791 if : env.coverage == 'true'
8892
8993 lint :
94+ needs :
95+ - prepare
9096 runs-on : ubuntu-latest
9197
9298 # lint shouldn't need more than 10 min
@@ -95,31 +101,18 @@ jobs:
95101 steps :
96102 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
97103 with :
98- fetch-depth : 2
99104 show-progress : false
100- filter : blob:none # we don't need all blobs
101105
102- - name : Enable corepack
103- run : corepack enable
104-
105- - name : Set up Node.js ${{ env.NODE_VERSION }}
106- uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
107- with :
108- node-version : ${{ env.NODE_VERSION }}
109- cache : pnpm
106+ - name : 📥 Setup Node.js
107+ uses : ./.github/actions/setup-node
110108
111109 - name : Init platform
112110 run : |
113111 git config --global core.autocrlf false
114112 git config --global core.symlinks true
115- git config --global user.email ${GIT_EMAIL}
116- git config --global user.name 'Renovate Bot'
117113 echo "Node $(node --version)"
118114 echo "pnpm $(pnpm --version)"
119115
120- - name : Installing dependencies
121- run : pnpm install
122-
123116 - name : Lint
124117 run : |
125118 pnpm eslint -f gha
@@ -130,7 +123,9 @@ jobs:
130123 run : pnpm type-check
131124
132125 release :
133- needs : [lint, test]
126+ needs :
127+ - lint
128+ - test
134129 runs-on : ubuntu-latest
135130 # release shouldn't need more than 5 min
136131 timeout-minutes : 15
@@ -147,21 +142,15 @@ jobs:
147142 show-progress : false
148143 filter : blob:none # we don't need all blobs
149144
150- - name : Enable corepack
151- run : corepack enable
152-
153- - name : Set up Node.js ${{ env.NODE_VERSION }}
154- uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
155- with :
156- node-version : ${{ env.NODE_VERSION }}
157- cache : pnpm
145+ - name : 📥 Setup Node.js
146+ uses : ./.github/actions/setup-node
158147
159148 - name : Init platform
160149 run : |
161150 git config --global core.autocrlf false
162151 git config --global core.symlinks true
163- git config --global user.email ${GIT_EMAIL}
164- git config --global user.name 'Renovate Bot'
152+ git config --global user.name "github-actions[bot]"
153+ git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
165154
166155 - name : Check dry run
167156 run : |
@@ -173,9 +162,6 @@ jobs:
173162 echo "DRY_RUN=false" >> $GITHUB_ENV
174163 fi
175164
176- - name : Installing dependencies
177- run : pnpm install
178-
179165 - name : semantic-release
180166 run : pnpm semantic-release --dry-run ${{github.ref != 'refs/heads/main'}} --ci ${{github.ref == 'refs/heads/main'}}
181167 env :
0 commit comments