orchard/.github/workflows/ci.yml

107 lines
3.0 KiB
YAML
Raw Normal View History

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:
2023-11-28 15:31:35 -08:00
- uses: actions/checkout@v4
2020-10-20 14:35:55 -07:00
- name: Run tests
run: cargo test --verbose
2023-11-28 15:31:35 -08:00
- name: Verify working directory is clean
run: git diff --exit-code
2020-10-20 14:12:37 -07:00
2023-11-28 15:31:35 -08:00
build-latest:
name: Latest build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
id: toolchain
- run: rustup override set ${{steps.toolchain.outputs.name}}
- name: Remove lockfile to build with latest dependencies
run: rm Cargo.lock
- name: Build crate
run: cargo build --all-features --verbose
- name: Verify working directory is clean (excluding lockfile)
run: git diff --exit-code ':!Cargo.lock'
build-nodefault:
name: Build target ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
matrix:
target:
- wasm32-wasi
steps:
2023-11-28 15:31:35 -08:00
- uses: actions/checkout@v4
- name: Add target
run: rustup target add ${{ matrix.target }}
- run: cargo fetch
- name: Build for ${{ matrix.target }} target
run: cargo build --verbose --no-default-features --target ${{ matrix.target }}
2020-10-20 14:35:55 -07:00
bitrot:
name: Bitrot check
runs-on: ubuntu-latest
steps:
2023-11-28 15:31:35 -08:00
- uses: actions/checkout@v4
2020-10-20 14:12:37 -07:00
# Build benchmarks to prevent bitrot
- name: Build benchmarks
run: cargo build --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:
2023-11-28 15:31:35 -08:00
- uses: actions/checkout@v4
- name: Install mdbook
run: |
mkdir mdbook
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.35/mdbook-v0.4.35-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
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
2023-11-28 15:31:35 -08:00
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
2020-10-20 14:12:37 -07:00
steps:
2023-11-28 15:31:35 -08:00
- uses: actions/checkout@v4
2020-10-20 14:35:55 -07:00
- name: Generate coverage report
2023-11-28 15:31:35 -08:00
run: cargo tarpaulin --engine llvm --all-features --release --timeout 600 --out xml
2020-10-20 14:35:55 -07:00
- name: Upload coverage to Codecov
2023-11-28 15:31:35 -08:00
uses: codecov/codecov-action@v3.1.4
2020-10-20 14:35:55 -07:00
doc-links:
name: Intra-doc links
runs-on: ubuntu-latest
steps:
2023-11-28 15:31:35 -08:00
- uses: actions/checkout@v4
- run: cargo fetch
2023-11-28 15:31:35 -08:00
# Requires #![deny(rustdoc::broken_intra_doc_links)] in crates.
2020-10-20 14:35:55 -07:00
- name: Check intra-doc links
2023-11-28 15:31:35 -08:00
run: cargo doc --all-features --document-private-items
2020-10-20 14:35:55 -07:00
fmt:
name: Rustfmt
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
2023-11-28 15:31:35 -08:00
- uses: actions/checkout@v4
- run: cargo fmt -- --check