-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (45 loc) · 1.34 KB
/
tests.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
name: Tests
on:
push:
branches: [ main ]
pull_request:
# Allow parallel jobs on `main` to test each commit. For PRs, only run on the latest commit.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
name: Grammar Tests
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run log:versions
- run: npm run build
# TODO: Abort if there are diffs; see #18
- name: Ensure generated files are up-to-date
run: |
# package.json may change due to custom scripts
git checkout HEAD -- package.json
git diff --diff-filter=M --color | head -n 100
git diff --diff-filter=M --quiet || (echo 'Generated grammar is not up-to-date: run `npm run build` and commit all changes')
git reset --hard HEAD
- run: npm run test:all
- run: npm run lint
- name: test rust bindings
run: |
cargo build --verbose
cargo test --verbose
- name: test node bindings
run: |
cd test/bindings/node
npm ci
npm test