Repository navigation
68 lines (64 loc) · 2.19 KB
/
Copy pathci.yml
File metadata and controls
68 lines (64 loc) · 2.19 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
name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
compatibility:
name: Node 22.0 / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
# Node 22.0's npm.ps1 is broken on Windows; Bash selects the bundled npm shell shim instead.
# https://github.com/nodejs/node/issues/52682
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 22.0.0
package-manager-cache: false
- run: npm ci --omit=dev --ignore-scripts
- run: npm test
- run: npm run pack:check
- run: npm run pack:smoke
quality:
name: Node 24 quality
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24.18.0
package-manager-cache: false
- name: Verify release toolchain
run: |
test "$(node --version)" = "v24.18.0"
test "$(npm --version)" = "11.16.0"
- run: npm ci --ignore-scripts
- run: npm audit
- run: npm run check
# A missing entry found at tag time would cost the tagged version, so check it before the tag exists.
- name: Require a changelog entry for an untagged version
run: |
set -euo pipefail
version="$(node --print 'JSON.parse(require("node:fs").readFileSync("package.json", "utf8")).version')"
status=0
git ls-remote --exit-code --tags origin "refs/tags/v$version" > /dev/null || status=$?
case "$status" in
0) echo "v$version is tagged, so this check does not apply." ;;
2) node scripts/check-changelog.js "$version" ;;
*) exit "$status" ;;
esac