2020-08-22 13:32:28 -07:00
|
|
|
name: CI checks
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
2020-10-29 17:45:07 -07:00
|
|
|
test:
|
|
|
|
name: Test on ${{ matrix.os }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-02-15 15:35:11 -08:00
|
|
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
2020-08-22 13:32:28 -07:00
|
|
|
|
|
|
|
steps:
|
2022-04-28 17:26:50 -07:00
|
|
|
- uses: actions/checkout@v3
|
2020-08-22 13:32:28 -07:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-04-27 04:16:48 -07:00
|
|
|
toolchain: 1.56.1
|
2020-08-22 13:32:28 -07:00
|
|
|
override: true
|
2020-10-29 17:45:07 -07:00
|
|
|
- name: Run tests
|
2020-08-22 13:32:28 -07:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
2020-10-29 17:45:07 -07:00
|
|
|
command: test
|
|
|
|
args: --verbose --release --all --all-features
|
2020-08-22 13:32:28 -07:00
|
|
|
|
2020-12-01 13:00:47 -08:00
|
|
|
build:
|
|
|
|
name: Build target ${{ matrix.target }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
target:
|
|
|
|
- wasm32-unknown-unknown
|
|
|
|
- wasm32-wasi
|
|
|
|
|
|
|
|
steps:
|
2022-04-28 17:26:50 -07:00
|
|
|
- uses: actions/checkout@v3
|
2020-12-01 13:00:47 -08:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-04-27 04:16:48 -07:00
|
|
|
toolchain: 1.56.1
|
2020-12-01 13:00:47 -08:00
|
|
|
override: true
|
|
|
|
- name: Add target
|
|
|
|
run: rustup target add ${{ matrix.target }}
|
|
|
|
- name: cargo build
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
2022-01-27 15:44:42 -08:00
|
|
|
args: --features dev-graph,gadget-traces,unstable --target ${{ matrix.target }}
|
2020-12-01 13:00:47 -08:00
|
|
|
|
2020-10-29 17:45:07 -07:00
|
|
|
bitrot:
|
|
|
|
name: Bitrot check
|
|
|
|
runs-on: ubuntu-latest
|
2020-08-22 13:32:28 -07:00
|
|
|
|
2020-10-29 17:45:07 -07:00
|
|
|
steps:
|
2022-04-28 17:26:50 -07:00
|
|
|
- uses: actions/checkout@v3
|
2020-10-29 17:45:07 -07:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-04-27 04:16:48 -07:00
|
|
|
toolchain: 1.56.1
|
2020-10-29 17:45:07 -07:00
|
|
|
override: true
|
2020-08-22 13:32:28 -07:00
|
|
|
# Build benchmarks to prevent bitrot
|
|
|
|
- name: Build benchmarks
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
2021-07-08 14:33:03 -07:00
|
|
|
args: --benches --examples --all-features
|
2020-08-22 13:32:28 -07:00
|
|
|
|
2020-12-04 08:15:06 -08:00
|
|
|
book:
|
|
|
|
name: Book tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-04-28 17:26:50 -07:00
|
|
|
- uses: actions/checkout@v3
|
2021-01-05 16:43:16 -08:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-04-27 04:16:48 -07:00
|
|
|
toolchain: 1.56.1
|
2021-01-05 16:43:16 -08:00
|
|
|
override: true
|
2020-12-10 12:18:32 -08:00
|
|
|
- name: cargo build
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
2020-12-04 08:15:06 -08:00
|
|
|
- name: Setup mdBook
|
|
|
|
uses: peaceiris/actions-mdbook@v1
|
|
|
|
with:
|
2021-01-08 18:37:05 -08:00
|
|
|
mdbook-version: '0.4.5'
|
2020-12-04 08:15:06 -08:00
|
|
|
- name: Test halo2 book
|
2020-12-10 12:18:32 -08:00
|
|
|
run: mdbook test -L target/debug/deps book/
|
2020-12-04 08:15:06 -08:00
|
|
|
|
2020-10-29 17:45:07 -07:00
|
|
|
codecov:
|
|
|
|
name: Code coverage
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-04-28 17:26:50 -07:00
|
|
|
- uses: actions/checkout@v3
|
2020-10-29 17:45:07 -07:00
|
|
|
# Use stable for this to ensure that cargo-tarpaulin can be built.
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
- name: Install cargo-tarpaulin
|
2020-08-22 13:32:28 -07:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
2020-10-29 17:45:07 -07:00
|
|
|
command: install
|
|
|
|
args: cargo-tarpaulin
|
|
|
|
- name: Generate coverage report
|
2020-08-22 13:32:28 -07:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
2020-10-29 17:45:07 -07:00
|
|
|
command: tarpaulin
|
|
|
|
args: --all-features --timeout 600 --out Xml
|
|
|
|
- name: Upload coverage to Codecov
|
2022-04-22 03:23:09 -07:00
|
|
|
uses: codecov/codecov-action@v3.1.0
|
2020-10-29 17:45:07 -07:00
|
|
|
|
|
|
|
doc-links:
|
|
|
|
name: Intra-doc links
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-04-28 17:26:50 -07:00
|
|
|
- uses: actions/checkout@v3
|
2020-10-29 17:45:07 -07:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-04-27 04:16:48 -07:00
|
|
|
toolchain: 1.56.1
|
2020-10-29 17:45:07 -07:00
|
|
|
override: true
|
|
|
|
- name: cargo fetch
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fetch
|
|
|
|
|
|
|
|
# Ensure intra-documentation links all resolve correctly
|
|
|
|
# Requires #![deny(intra_doc_link_resolution_failure)] in crates.
|
|
|
|
- name: Check intra-doc links
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: doc
|
|
|
|
args: --all --document-private-items
|
|
|
|
|
|
|
|
fmt:
|
|
|
|
name: Rustfmt
|
|
|
|
timeout-minutes: 30
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-04-28 17:26:50 -07:00
|
|
|
- uses: actions/checkout@v3
|
2020-10-29 17:45:07 -07:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-04-27 04:16:48 -07:00
|
|
|
toolchain: 1.56.1
|
2020-10-29 17:45:07 -07:00
|
|
|
override: true
|
|
|
|
- run: rustup component add rustfmt
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|