Skip to content

Commit ab54d4f

Browse files
committed
ci: improve e2e tests
1 parent 9fb9991 commit ab54d4f

File tree

1 file changed

+9
-26
lines changed

1 file changed

+9
-26
lines changed

.github/workflows/reusable-test.yml

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -254,50 +254,33 @@ jobs:
254254
with:
255255
node-version: ${{ vars.DEFAULT_NODE_VERSION }}
256256

257-
# - name: Install dependencies
258-
# run: npm ci
259-
260-
# - name: Build package
261-
# run: npm run build
262-
263257
- name: Install jq
264258
run: apt-get update && apt-get install -y jq
265259

266-
- name: Check if artifact exists
267-
id: check_node_modules_artifact
268-
run: |
269-
ARTIFACT_NAME="modern-node-modules-${{ hashFiles('**/package-lock.json') }}"
270-
ARTIFACT_EXISTS=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
271-
"https://api.github.com/repos/${{ github.repository }}/actions/artifacts" | \
272-
jq --arg name "$ARTIFACT_NAME" '.artifacts[] | select(.name == $name) | .id' | wc -l)
273-
274-
echo "artifact_exists=$ARTIFACT_EXISTS" >> $GITHUB_ENV
275-
276-
if [ "$ARTIFACT_EXISTS" -gt "0" ]; then
277-
echo "artifact_exists=true" >> $GITHUB_OUTPUT
278-
else
279-
echo "artifact_exists=false" >> $GITHUB_OUTPUT
280-
fi
281-
282260
- name: Download node_modules from artifacts
261+
id: download_node_modules
283262
if: steps.check_node_modules_artifact.outputs.artifact_exists == 'true'
284263
uses: actions/download-artifact@v4
264+
continue-on-error: true
285265
with:
286266
name: modern-node-modules-${{ hashFiles('**/package-lock.json') }}
287267
path: node_modules
288268

289269
- name: Install dependencies
290-
if: steps.check_node_modules_artifact.outputs.artifact_exists == 'false'
270+
if: steps.download_node_modules.outcome != 'success'
291271
run: npm ci
292272

293-
- name: ls
294-
run: ls -la node_modules/.bin
295-
296273
- name: Download build output from artifacts
274+
id: download_build_output
297275
uses: actions/download-artifact@v4
276+
continue-on-error: true
298277
with:
299278
name: ${{ runner.os }}-modern-build-output-${{ github.sha }}
300279

280+
- name: Build package
281+
if: steps.download_build_output.outcome != 'success'
282+
run: npm run build
283+
301284
- name: Run e2e tests
302285
run: npm run task:run-e2e
303286

0 commit comments

Comments
 (0)