-
Notifications
You must be signed in to change notification settings - Fork 7
60 lines (57 loc) · 1.56 KB
/
pr-build.yml
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: JavaScript Instrumentation PR Build
on:
pull_request:
branches:
- main
- "release/v*"
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
node: ["14", "16", "18", "20", "22"]
env:
NPM_CONFIG_UNSAFE_PERM: true
steps:
- name: Checkout Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Update npm to a version that supports workspaces (v7 or later)
if: ${{ matrix.node < 16 }}
run: npm install -g npm@9 # npm@9 supports node >=14.17.0
- name: NPM Clean Install
# https://docs.npmjs.com/cli/v10/commands/npm-ci
run: npm ci
- name: Compile all NPM projects
run: npm run compile
- name: Unit tests (Full)
if: matrix.code-coverage
run: npm run test
- name: Report Coverage
if: ${{ matrix.code-coverage && !cancelled()}}
uses: codecov/codecov-action@v4
with:
verbose: true
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- run: npm ci
- name: Lint
run: |
npm run lint
npm run lint:markdown
npm run lint:readme