-
Notifications
You must be signed in to change notification settings - Fork 27
97 lines (81 loc) · 2.73 KB
/
test-pr.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
name: Test PR
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
on:
pull_request:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-13, macos-14]
node: [18, 20, 22]
runs-on: ${{ matrix.os }}
name: Node ${{ matrix.os }}, node-${{ matrix.node }} sample
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
registry-url: "https://registry.npmjs.org"
scope: "@hpcc-js"
- name: Install Ubuntu Dependencies
if: ${{ contains(matrix.os, 'ubuntu') }}
run: |
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y git cmake ninja-build wget zip
sudo apt-get install -y gcc-multilib g++-multilib pkg-config autoconf bison libtool flex
sudo apt-get install -y python3 python3-pip
- name: Install OSX Dependencies
if: ${{ contains(matrix.os, 'macos') }}
shell: "bash"
run: |
brew install ninja flex bison automake autoconf-archive coreutils llvm
echo 'export PATH="/usr/local/opt/bison/bin:/usr/local/opt/flex/bin:/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: npm ci
shell: "bash"
run: |
npm ci
- name: npx playwright install
shell: "bash"
run: |
npx playwright install --with-deps
- name: install-build-deps
shell: "bash"
run: |
npm run install-build-deps
- name: Lint
shell: "bash"
run: |
npm run lint
- name: Build
shell: "bash"
run: |
npm run build
- name: Test
shell: "bash"
run: |
npm run test
- name: Calculate Coverage
if: ${{ matrix.os == 'ubuntu-24.04' && matrix.node == 20 }}
shell: "bash"
run: |
npm run coverage
- name: Upload error logs
if: ${{ failure() || cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.node }}-logs
path: |
./vcpkg/buildtrees/**/*.log
./build/**/*.log