-
Notifications
You must be signed in to change notification settings - Fork 33
59 lines (50 loc) · 1.59 KB
/
node.js.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
name: Node.js CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-2019, macos-latest]
node-version: [16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npx prettier --check .
- run: npm run gen
- name: Verify generated code
if: runner.os == 'Linux'
run: |
if ! git diff --quiet --ignore-submodules -- src/
then
echo >&2 "Generated files in src/ differ, please run 'npm run gen' to update generated code"
git diff-index --name-status -r --ignore-submodules HEAD src/ >&2
fi
- run: npm test
#- name: Parse real world examples (ignoring errors for now)
# continue-on-error: true
# run: npm acceptance
compile:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
compiler: [gcc, clang++]
name: compile
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- if: matrix.os == 'windows-latest' && matrix.compiler == 'gcc'
uses: egor-tensin/setup-mingw@v2
- name: build
run: ${{ matrix.compiler }} -o scanner.o -I./src -c src/scanner.cc -Werror