blob: 1b44abbc54722643d5f38bdfb30173c7a11bbf5e [file] [log] [blame]
name: Rust
on:
pull_request:
push:
branches:
- master
schedule:
- cron: "00 01 * * *"
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust:
- stable
- beta
- nightly
- "1.63.0"
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain/@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
- name: Run Tests
uses: actions-rs/cargo@v1
with:
command: test
args: ${{ matrix.features }}
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: rustfmt
- name: Check Clippy
run: cargo clippy --all --tests --workspace -- -D warnings
docs:
name: docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps --document-private-items --workspace
coverage:
name: coverage
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --workspace --lcov --output-path lcov.info
- name: Upload coverage to coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov.info