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:
|
|
|
|
# We don't need to test across multiple platforms yet
|
|
|
|
# os: [ubuntu-latest, windows-latest, macOS-latest]
|
|
|
|
os: [ubuntu-latest]
|
2020-08-22 13:32:28 -07:00
|
|
|
|
|
|
|
steps:
|
2020-10-29 17:45:07 -07:00
|
|
|
- uses: actions/checkout@v2
|
2020-08-22 13:32:28 -07:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-06-01 16:01:04 -07:00
|
|
|
toolchain: 1.51.0
|
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:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-06-01 16:01:04 -07:00
|
|
|
toolchain: 1.51.0
|
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
|
|
|
|
args: --all-features
|
|
|
|
|
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:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-06-01 16:01:04 -07:00
|
|
|
toolchain: 1.51.0
|
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
|
2020-10-29 17:45:07 -07:00
|
|
|
args: --all --benches --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:
|
|
|
|
- uses: actions/checkout@v2
|
2021-01-05 16:43:16 -08:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-06-01 16:01:04 -07:00
|
|
|
toolchain: 1.51.0
|
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:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
# 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
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
token: ${{secrets.CODECOV_TOKEN}}
|
|
|
|
|
|
|
|
doc-links:
|
|
|
|
name: Intra-doc links
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-06-01 16:01:04 -07:00
|
|
|
toolchain: 1.51.0
|
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:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-06-01 16:01:04 -07:00
|
|
|
toolchain: 1.51.0
|
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
|