Repository navigation
70 lines (66 loc) · 2.02 KB
/
Copy pathnodejs.yml
File metadata and controls
70 lines (66 loc) · 2.02 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
name: build
on:
push:
branches: [master]
pull_request:
types: [opened, synchronize, reopened]
branches: [master]
workflow_dispatch:
permissions:
contents: read
jobs:
check:
name: Build and check (Node 24)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-node@v7.1.0
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm run check
- name: Upload coverage
uses: actions/upload-artifact@v7.0.2
with:
name: coverage
path: coverage/lcov.info
if-no-files-found: error
- name: Pack the checked build
run: |
mkdir artifacts
npm pack --ignore-scripts --pack-destination artifacts
- uses: actions/upload-artifact@v7.0.2
with:
name: npm-package
path: artifacts/*.tgz
if-no-files-found: error
runtime:
name: Packed runtime Node ${{ matrix.node }}
needs: check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['12.0.0', '12', '14', '16', '18', '20', '22', '24', '26']
steps:
- uses: actions/checkout@v7.0.1
- name: Select the consumer runtime
uses: actions/setup-node@v7.1.0
with:
node-version: ${{ matrix.node }}
- name: Record the consumer executable
id: runtime-path
run: echo "node=$(node -p process.execPath)" >> "$GITHUB_OUTPUT"
- name: Use development Node for npm and TypeScript
uses: actions/setup-node@v7.1.0
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci --ignore-scripts
- uses: actions/download-artifact@v8.0.2
with:
name: npm-package
path: artifacts
- name: Run the complete suite and consumers against the tarball
run: npm run test:packed -- "artifacts/posthtml-render-$(node -p 'require("./package.json").version').tgz" --node "${{ steps.runtime-path.outputs.node }}"