jotdown/.github/workflows/ci.yml
Noah Hellman 3cea79a122 mv suite{_bench} to test-html-{ut,ref} crates
- allow compiling/running html tests without compiling main crate tests
  (useful when e.g. making type changes to events but html unaffected)
- avoid need for future flags in main crate
2023-05-04 19:34:23 +02:00

113 lines
2.7 KiB
YAML

name: ci
on:
push:
branches:
- master
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Build and run tests
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- "1.56"
- stable
steps:
- name: "Checkout repo"
uses: actions/checkout@v3
- name: "Setup toolchain"
run: |
rustup update ${{ matrix.toolchain }}
rustup default ${{ matrix.toolchain }}
- name: "Build"
run: |
make all
cargo build --workspace --no-default-features
- name: "Run tests"
env:
RUSTDOCFLAGS: -D warnings
run: |
make check
test_html:
name: Build and run HTML tests
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v3
- name: "Setup toolchain"
run: |
rustup update 1.56
rustup default 1.56
- name: "Run HTML unit tests"
run: make test_html_ut
- name: "Setup node"
uses: actions/setup-node@v3
with:
node-version: 18
- name: "Compare HTML with reference implementation"
run: make test_html_ref
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Setup toolchain"
run: |
rustup update 1.56
rustup default 1.56
rustup component add rustfmt
rustup component add clippy
- name: "Check linting"
run: make lint
fuzz:
name: Fuzz
strategy:
matrix:
target:
- parse
- parse_balance
- html
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Setup toolchain"
run: |
rustup update nightly
rustup default nightly
cargo install afl
- name: "Fuzz"
run: |
echo core | sudo tee /proc/sys/kernel/core_pattern
AFL_TARGET=${{ matrix.target }} make afl_quick
bench:
name: Benchmark
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v3
- name: "Setup toolchain"
run: |
rustup update stable
rustup default stable
sudo apt-get install valgrind
- name: "Fetch benchmark inputs"
run: make bench
- name: "Benchmark"
run: |
cargo bench -p bench-crit all > crit
cargo bench -p bench-iai > iai
- name: "Artifact results"
uses: actions/upload-artifact@v3
with:
name: benchmark
path: |
crit
iai