orchard/.github/workflows/ci.yml

138 lines
3.3 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:
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:
2023-02-28 14:20:39 -08:00
toolchain: 1.60.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
args: --verbose
2020-10-20 14:12:37 -07:00
build:
name: Build target ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
matrix:
target:
- wasm32-wasi
steps:
- uses: actions/checkout@v3
- 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
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:
2023-02-28 14:20:39 -08:00
toolchain: 1.60.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
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:
2023-02-28 14:20:39 -08:00
toolchain: 1.60.0
2021-03-25 12:13:25 -07:00
override: true
2020-10-27 14:23:35 -07:00
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
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:
2023-02-28 14:20:39 -08:00
toolchain: 1.60.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:
2023-02-28 14:20:39 -08:00
toolchain: 1.60.0
2020-10-20 14:35:55 -07:00
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check