@@ -13,19 +13,16 @@ permissions:
1313 issues : write # comment on released issues
1414 pull-requests : write # comment on released pull requests
1515
16-
1716jobs :
1817 setup :
1918 runs-on : ubuntu-latest
20- env :
19+ env :
2120 DETECT_CHROMEDRIVER_VERSION : " true"
2221 JEST_JUNIT_OUTPUT_DIR : test-results
2322 NODE_OPTIONS : --max-old-space-size=4000
2423 steps :
25- - uses : actions/checkout@v4
26- - uses : wagoid/commitlint-github-action@v5
27- if : github.ref_name == 'develop'
28- - uses : actions/setup-node@v3
24+ - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
25+ - uses : actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
2926 with :
3027 cache : " npm"
3128 node-version-file : " .nvmrc"
@@ -43,29 +40,29 @@ jobs:
4340 run : |
4441 npm run test:lint -- --quiet --output-file test-results/eslint/results.xml --format junit
4542 - name : Store Lint Results
46- uses : actions/upload-artifact@v3
43+ uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
4744 with :
4845 name : lint-output
4946 path : ./test-results/*
5047 - name : Cache node_modules
5148 id : cache-nodemodules
52- uses : actions/cache@v3
49+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
5350 with :
54- path :
51+ path :
5552 node_modules
5653 key : ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
5754 - name : Cache src/generated
5855 id : cache-generated
59- uses : actions/cache@v3
56+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
6057 with :
61- path :
58+ path :
6259 src/generated
6360 key : ${{ runner.os }}-generated-${{ hashFiles('package-lock.json') }}
6461 - name : Cache static/microbit
6562 id : cache-static
66- uses : actions/cache@v3
63+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
6764 with :
68- path :
65+ path :
6966 static/microbit
7067 key : ${{ runner.os }}-microbit-${{ hashFiles('package-lock.json') }}
7168 test-unit :
@@ -75,73 +72,72 @@ jobs:
7572 JEST_JUNIT_OUTPUT_NAME : unit-results.xml
7673 JEST_JUNIT_OUTPUT_DIR : test-results/unit
7774 steps :
78- - uses : actions/checkout@v4
75+ - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
7976 - name : Cache NPM dependencies
80- uses : actions/cache@v3
77+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
8178 with :
82- path :
79+ path :
8380 node_modules
8481 key : ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
8582 - name : Run Unit Tests
8683 run : npm run test:unit -- --reporters="default" --reporters="jest-junit" --coverage --coverageReporters=text --coverageReporters=lcov --maxWorkers="2"
8784 - name : Store Unit Test Results
88- uses : actions/upload-artifact@v3
85+ uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
8986 with :
9087 name : unit-test-output
9188 path : ./test-results/*
9289 build :
9390 needs : [setup, test-unit]
94- env :
91+ env :
9592 NODE_OPTIONS : --max-old-space-size=4000
96- DETECT_CHROMEDRIVER_VERSION : " true"
9793 runs-on : ubuntu-latest
9894 steps :
99- - uses : actions/checkout@v4
100- - uses : actions/setup-node@v3
95+ - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
96+ - uses : actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
10197 with :
10298 cache : " npm"
10399 node-version-file : " .nvmrc"
104100 - name : Retrieve node_modules
105- uses : actions/cache@v3
101+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
106102 with :
107- path :
103+ path :
108104 node_modules
109105 key : ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
110106 - name : Retrieve src/generated
111- uses : actions/cache@v3
107+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
112108 with :
113- path :
109+ path :
114110 src/generated
115111 key : ${{ runner.os }}-generated-${{ hashFiles('package-lock.json') }}
116112 - name : Retireve static/microbit
117- uses : actions/cache@v3
113+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
118114 with :
119- path :
115+ path :
120116 static/microbit
121117 key : ${{ runner.os }}-microbit-${{ hashFiles('package-lock.json') }}
122118 - name : Run Build
123119 env :
124120 NODE_ENV : production
125121 run : npm run build
126122 - name : Cache Build Directory
127- uses : actions/cache@v3
123+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
128124 with :
129- path :
125+ path :
130126 ./build
131127 key : ${{ runner.os }}-build-${{ hashFiles('package-lock.json') }}
132128 - name : Cache Dist Directory
133- uses : actions/cache@v3
129+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
134130 with :
135- path :
131+ path :
136132 ./dist
137133 key : ${{ runner.os }}-dist-${{ hashFiles('package-lock.json') }}
138134 - name : Store Build Output
139- uses : actions/upload-artifact@v3
135+ uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
140136 with :
141137 name : build-output
142138 path : ./build
143139 - name : Store Dist Output
144- uses : actions/upload-artifact@v3
140+ uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
145141 with :
146142 name : dist-output
147143 path : ./dist
@@ -152,86 +148,77 @@ jobs:
152148 JEST_JUNIT_OUTPUT_NAME : results.txt
153149 JEST_JUNIT_OUTPUT_DIR : test-results/integration
154150 steps :
155- - uses : actions/checkout@v4
156- - name : Install Chrome Dependencies
157- run : |
158- sudo apt-get update
159- sudo apt-get install -y libgconf-2-4 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm-dev libnss3-dev libxss-dev libasound2
151+ - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
160152 - name : Retrieve npm dependencies
161- uses : actions/cache@v3
153+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
162154 with :
163- path :
155+ path :
164156 node_modules
165157 key : ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
166158 - name : Retrieve Build
167- uses : actions/cache@v3
159+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
168160 with :
169- path :
161+ path :
170162 ./build
171163 key : ${{ runner.os }}-build-${{ hashFiles('package-lock.json') }}
172- - uses : browser-actions/setup-chrome@v1
173- with :
174- chrome-version : stable
175- id : setup-chrome
176164 - run : |
177- echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }}
178- ${{ steps.setup-chrome.outputs.chrome-path }} --version
165+ for F in chrome chromium chromedriver; do
166+ which $F && $F --version || echo Not found: $F
167+ done
179168 - name : Run Integration Tests
180169 run : npm run test:integration -- --reporters="default" --reporters="jest-junit"
181170 - name : Store Integration Test Results
182- uses : actions/upload-artifact@v3
171+ uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
183172 with :
184173 name : integration-test-output
185174 path : ./test-results/*
186175 deploy-npm :
187176 needs : [test-integration, test-unit]
188- if : ${{ startsWith (github.ref, 'refs/heads/master') || startsWith (github.ref, 'refs/heads/hotfix ') || startsWith (github.ref, 'refs/heads/beta') }}
177+ if : (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/develop ') || (github.ref == 'refs/heads/beta') || startsWith(github.ref, 'refs/heads/hotfix')
189178 runs-on : ubuntu-latest
190179 steps :
191- - uses : actions/checkout@v4
180+ - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
192181 - name : Retrieve npm dependencies
193- uses : actions/cache@v3
182+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
194183 with :
195- path :
184+ path :
196185 node_modules
197186 key : ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
198187 - name : Retrieve Dist Directory
199- uses : actions/cache@v3
188+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
200189 with :
201- path :
190+ path :
202191 ./dist
203192 key : ${{ runner.os }}-dist-${{ hashFiles('package-lock.json') }}
204193 - run : |
205194 if [[ ${{contains(github.ref, 'hotfix')}} ]]; then
206195 sed -e "s|hotfix/REPLACE|${{ github.ref_name }}|" --in-place release.config.js
207196 fi
208197 - name : Semantic Release
209-
210198 env :
211199 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
212200 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
213201 run : npx --no -- semantic-release
214202 deploy-gh-pages :
215203 needs : [test-integration, test-unit]
216- if : ${{ startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/heads/hotfix ') || startsWith(github.ref, 'refs/heads/beta') }}
204+ if : (!( startsWith(github.ref, 'refs/heads/dependabot/ ') || startsWith(github.ref, 'refs/heads/renovate/')))
217205 runs-on : ubuntu-latest
218206 steps :
219- - uses : actions/checkout@v4
207+ - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
220208 - name : Retrieve npm dependencies
221- uses : actions/cache@v3
209+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
222210 with :
223- path :
211+ path :
224212 node_modules
225213 key : ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
226214 - name : Retrieve Build Directory
227- uses : actions/cache@v3
215+ uses : actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
228216 with :
229- path :
217+ path :
230218 ./build
231219 key : ${{ runner.os }}-build-${{ hashFiles('package-lock.json') }}
232220 - name : Deploy playground to GitHub Pages
233-
234- uses : peaceiris/actions-gh-pages@v3
221+ uses : peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3
235222 with :
236223 github_token : ${{ secrets.GITHUB_TOKEN }}
237224 publish_dir : ./build
0 commit comments