-
Notifications
You must be signed in to change notification settings - Fork 7
75 lines (71 loc) · 1.97 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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"]
include:
- node: 18
code-coverage: true
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: Build Lambda Layer
run: npm run build-lambda
- name: Unit tests (Full)
run: npm run test:coverage
- name: Report Coverage
if: ${{ matrix.code-coverage && !cancelled()}}
uses: codecov/codecov-action@v4
with:
verbose: true
contract-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: run contract tests
run: |
bash ./scripts/build_and_install_distro.sh
bash scripts/set-up-contract-tests.sh
pip install pytest
pytest contract-tests/tests
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