-
Notifications
You must be signed in to change notification settings - Fork 156
101 lines (91 loc) · 2.92 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
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
name: Node.js SDK Continuous Build
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
name: Build Node ${{ matrix.node-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
node-version:
- 14.x
- 16.x
- 18.x
- 20.x
include:
- os: ubuntu-latest
node-version: 16.x
coverage: true
- os: macos-13
node-version: 14.x
exclude:
# Issue with npm6 on windows resulting in failing workflows:
# https://github.com/npm/cli/issues/4341#issuecomment-1040608101
# Since node14 is EOL, we can drop this set from our tests.
# We still test node14 on other platforms.
- os: windows-latest
node-version: 14.x
# https://github.com/actions/runner-images/issues/9741
# macos-latest provides only ARM hosts
# https://github.com/nodejs/node/issues/36161
# https://github.com/nodejs/node/issues/40126
# Without workarounds, Node.js 14 isn't supported on ARM macos
# As workaround, test on macos-13 version instead
- os: macos-latest
node-version: 14.x
steps:
- name: Checkout AWS XRay SDK Node Repository @ default branch latest
uses: actions/checkout@v3
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- run: npm install -g [email protected]
- name: Cache NPM modules
uses: actions/cache@v3
with:
path: |
node_modules
package-lock.json
packages/*/node_modules
packages/*/package-lock.json
key: ${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('package.json', 'packages/*/package.json') }}-06142023
- name: Bootstrap
run: |
npm ci
npx lerna bootstrap --no-ci --hoist
- name: Build
run: |
npx lerna run compile
shell: bash
- name: Execute tests with Lerna
if: '!matrix.coverage'
run: |
npx lerna run test
shell: bash
# Only need to report coverage once, so only run instrumented tests on one Node version/OS
# Use lerna to get reports from all packages
- name: Report coverage
if: matrix.coverage
run: |
npx lerna run testcov
npx lerna run reportcov
env:
CI: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: matrix.coverage
with:
directory: ./packages/core/
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.lcov
verbose: true