Repository navigation
112 lines (97 loc) · 3.89 KB
/
Copy pathnode.js.yml
File metadata and controls
112 lines (97 loc) · 3.89 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
permissions:
contents: read
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Superseding a pull request drops the run it replaces. Pushes to master are left
# alone, so every commit that lands is validated on its own.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
quality:
# Static analysis over the sources — nothing in it depends on the Node version
# it runs under, so it runs once rather than on every entry of the test matrix,
# and it needs no browser.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '24'
cache: 'npm'
- run: npm ci
- run: npm run lint
# Components and stories import the style modules compiled from SCSS, so type
# checking needs them on disk. `lint` does not, and runs before the wait.
- uses: ./.github/actions/restore-styles
- run: npm run build:styles
- run: npm run check
test-shard:
name: test (${{ matrix.node-version }}, shard ${{ matrix.shard }})
runs-on: ubuntu-latest
strategy:
# Report every shard rather than cancelling the rest on the first failure.
fail-fast: false
matrix:
node-version: [24.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
shard: ['1/3', '2/3', '3/3']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- uses: ./.github/actions/restore-styles
- uses: ./.github/actions/setup-playwright
- run: npm run test
env:
TEST_SHARD: ${{ matrix.shard }}
- name: Keep the coverage for the test job
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: coverage-${{ strategy.job-index }}
path: coverage/coverage-final.json
if-no-files-found: error
retention-days: 1
# A re-run of the shard replaces its coverage.
overwrite: true
test:
# The required status check. It also runs when a shard fails or is cancelled, and
# fails then, because a skipped required check counts as passed.
name: test (24.x)
needs: test-shard
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Check that every shard passed
if: ${{ needs.test-shard.result != 'success' }}
run: |
echo "::error::A test shard ended with \"${{ needs.test-shard.result }}\"."
exit 1
# Coveralls cannot merge the shards: see `scripts/merge-coverage.mjs`.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '24'
cache: 'npm'
- run: npm ci
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: coverage-*
path: shard-coverage
- run: node scripts/merge-coverage.mjs shard-coverage/*/coverage-final.json
- name: Publish to coveralls.io
uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8
with:
github-token: ${{ github.token }}
file: coverage/lcov.info
fail-on-error: false