update flake #470
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
name: Build, test, and bench | |
jobs: | |
cachix: | |
name: upload cachix | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
# Nix Flakes doesn't work on shallow clones | |
fetch-depth: 0 | |
- uses: cachix/install-nix-action@v20 | |
- uses: cachix/cachix-action@v12 | |
if: ${{ github.event_name == 'push' }} | |
with: | |
name: dcompass | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
# Don't push source or .iso files as they are pointless to take up precious cache space. | |
pushFilter: '(-source$|nixpkgs\.tar\.gz$|\.iso$|-squashfs.img$|crate-$)' | |
# Run the general flake checks | |
- run: nix flake check -vL | |
build: | |
name: Build all feature permutations | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}-check | |
- uses: actions-rs/[email protected] | |
with: | |
crate: cargo-all-features | |
version: latest | |
use-tool-cache: true | |
- run: cargo build-all-features | |
env: | |
RUSTFLAGS: -D warnings | |
test: | |
name: Test Suite | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/[email protected] | |
with: | |
crate: cargo-all-features | |
version: latest | |
use-tool-cache: true | |
- run: cargo test-all-features | |
env: | |
RUSTFLAGS: -D warnings | |
bench: | |
name: Benchmark | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}-bench | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- run: cargo bench --no-run | |
env: | |
RUSTFLAGS: -D warnings | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}-clippy | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- run: rustup component add clippy | |
- run: cargo clippy | |
env: | |
RUSTFLAGS: -D warnings |