2020-10-20 14:12:37 -07:00
|
|
|
name: CI checks
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
2020-10-20 14:35:55 -07:00
|
|
|
test:
|
|
|
|
name: Test on ${{ matrix.os }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
2020-10-20 14:12:37 -07:00
|
|
|
|
|
|
|
steps:
|
2020-10-20 14:35:55 -07:00
|
|
|
- uses: actions/checkout@v2
|
2020-10-20 14:12:37 -07:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-03-25 12:13:25 -07:00
|
|
|
toolchain: 1.51.0
|
2020-10-20 14:12:37 -07:00
|
|
|
override: true
|
2020-10-20 14:35:55 -07:00
|
|
|
- name: Run tests
|
2020-10-20 14:12:37 -07:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
2020-10-20 14:35:55 -07:00
|
|
|
command: test
|
2021-04-27 19:19:58 -07:00
|
|
|
args: --verbose
|
2020-10-20 14:12:37 -07:00
|
|
|
|
2020-10-20 14:35:55 -07:00
|
|
|
bitrot:
|
|
|
|
name: Bitrot check
|
|
|
|
runs-on: ubuntu-latest
|
2020-10-20 14:12:37 -07:00
|
|
|
|
2020-10-20 14:35:55 -07:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-03-25 12:13:25 -07:00
|
|
|
toolchain: 1.51.0
|
2020-10-20 14:35:55 -07:00
|
|
|
override: true
|
2020-10-20 14:12:37 -07:00
|
|
|
# Build benchmarks to prevent bitrot
|
|
|
|
- name: Build benchmarks
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
2021-04-26 19:13:48 -07:00
|
|
|
args: --benches
|
2020-10-20 14:12:37 -07:00
|
|
|
|
2020-10-27 14:23:35 -07:00
|
|
|
book:
|
|
|
|
name: Book tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-25 12:13:25 -07:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: 1.51.0
|
|
|
|
override: true
|
2020-10-27 14:23:35 -07:00
|
|
|
- name: Setup mdBook
|
|
|
|
uses: peaceiris/actions-mdbook@v1
|
|
|
|
with:
|
2021-01-08 18:35:40 -08:00
|
|
|
mdbook-version: '0.4.5'
|
2021-01-08 08:32:36 -08:00
|
|
|
- name: Test Orchard book
|
2020-10-27 14:23:35 -07:00
|
|
|
run: mdbook test book/
|
|
|
|
|
2020-10-20 14:35:55 -07:00
|
|
|
codecov:
|
|
|
|
name: Code coverage
|
|
|
|
runs-on: ubuntu-latest
|
2020-10-20 14:12:37 -07:00
|
|
|
|
|
|
|
steps:
|
2020-10-20 14:35:55 -07:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
# Use stable for this to ensure that cargo-tarpaulin can be built.
|
2020-10-20 14:12:37 -07:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2020-10-20 14:35:55 -07:00
|
|
|
toolchain: stable
|
2020-10-20 14:12:37 -07:00
|
|
|
override: true
|
2020-10-20 14:35:55 -07:00
|
|
|
- name: Install cargo-tarpaulin
|
2020-10-20 14:12:37 -07:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
2020-10-20 14:35:55 -07:00
|
|
|
command: install
|
|
|
|
args: cargo-tarpaulin
|
|
|
|
- name: Generate coverage report
|
2020-10-20 14:12:37 -07:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
2020-10-20 14:35:55 -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-03-25 12:13:25 -07:00
|
|
|
toolchain: 1.51.0
|
2020-10-20 14:35:55 -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
|
2021-03-25 12:13:25 -07:00
|
|
|
args: --document-private-items
|
2020-10-20 14:35:55 -07:00
|
|
|
|
|
|
|
fmt:
|
|
|
|
name: Rustfmt
|
|
|
|
timeout-minutes: 30
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-03-25 12:13:25 -07:00
|
|
|
toolchain: 1.51.0
|
2020-10-20 14:35:55 -07:00
|
|
|
override: true
|
|
|
|
- run: rustup component add rustfmt
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
2021-04-26 19:13:48 -07:00
|
|
|
args: -- --check
|