Repository navigation
60 lines (55 loc) · 1.95 KB
/
Copy pathactions-ci.yml
File metadata and controls
60 lines (55 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Build action CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
changes:
uses: ./.github/workflows/ci-changes.yml
test:
name: Build action suite${{ matrix.node == 26 && ' (Node 26)' || '' }}
needs: changes
if: ${{ needs.changes.outputs.build_action == 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [24, 26]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node }}
cache: npm
cache-dependency-path: actions/build/package-lock.json
- run: npm ci --ignore-scripts --engine-strict
working-directory: actions/build
- run: npm run lint
working-directory: actions/build
- run: actions/build/node_modules/.bin/playwright install --with-deps chromium
- run: npm test --prefix actions/build
- name: Prepare composite action fixture
if: ${{ matrix.node == 24 }}
run: cp actions/build/test/fixture/package.json actions/build/test/fixture/package-lock.json actions/build/test/fixture/fixture-build.mjs .
- uses: ./actions/build
if: ${{ matrix.node == 24 }}
result:
name: Replica action tests
needs: [changes, test]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Require the selected build-action suite to pass
env:
SELECTION_RESULT: ${{ needs.changes.result }}
SELECTED: ${{ needs.changes.outputs.build_action }}
TEST_RESULT: ${{ needs.test.result }}
run: |
test "$SELECTION_RESULT" = success
case "$SELECTED" in
true) test "$TEST_RESULT" = success ;;
false) test "$TEST_RESULT" = skipped ;;
*) echo "Invalid build-action suite selection" >&2; exit 1 ;;
esac