-
Notifications
You must be signed in to change notification settings - Fork 54
45 lines (42 loc) · 1.13 KB
/
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
name: Build
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm install
- name: Generate parser
run: npm run generate
- name: Verify that generated parser matches the repository
run: |
diff=`git diff HEAD -- src`
echo "$diff"
test -z "$diff"
- name: Check the parser size
run: |
size_kib="$(du -sk src/parser.c | cut -f1)"
size_mib="$((size_kib / 1024))"
max_size_mib=35
echo "The parser is now at $size_mib MiB"
if [ "$size_mib" -gt "$max_size_mib" ]; then
echo "This is greater than the maximum size of $max_size_mib MiB!"
exit 1
fi
shell: bash
- name: Run tests
run: npm test
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Build and test crate
run: cargo test