on: [push, pull_request]
name: Continuous integration
jobs:
check:
name: Compile and Test
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
rust:
- nightly
- stable
- 1.46.0
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- uses: actions-rs/cargo@v1
with:
command: check
args: --all --verbose
- uses: actions-rs/cargo@v1
with:
command: build
args: --all --verbose
- uses: actions-rs/cargo@v1
with:
command: test
args: --all --verbose
api-docs:
name: Publish API Docs to GitHub Pages
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: actions-rs/cargo@v1
with:
command: doc
args: --all --verbose
- name: Redirect top-level GitHub Pages
run: "echo '<meta http-equiv=\"refresh\" content=\"0; url=linkcheck/index.html\" />' > target/doc/index.html"
shell: bash
- name: GitHub Pages
uses: crazy-max/ghaction-github-pages@v2
with:
build_dir: target/doc
env:
GH_PAT: ${{ secrets.GH_TOKEN }}