Skip to content

Merge pull request #6 from kinnison/better-paths #53

Merge pull request #6 from kinnison/better-paths

Merge pull request #6 from kinnison/better-paths #53

Workflow file for this run

name: Basic
on:
pull_request:
branches:
- "*"
push:
branches:
- "*"
jobs:
build:
name: Build
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: true
matrix:
platform:
- ubuntu-latest
# - macos-latest
# - windows-latest
toolchain:
- stable
- beta
- nightly
include:
- platform: ubuntu-latest
toolchain: beta
clippyetc: true
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
name: Acquire minimal Rust ${{ matrix.toolchain }}
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
if: "!matrix.clippyetc"
- uses: actions-rs/toolchain@v1
name: Acquire minimal Rust ${{ matrix.toolchain }} with clippy and rustfmt
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
components: clippy, rustfmt
if: matrix.clippyetc
- name: Determine the compiler identity
shell: bash
id: rustc
run: |
echo "commit_hash=$(rustc -vV | grep commit-hash | cut -b14-23)" >> $GITHUB_OUTPUT
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo git trees
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-gits-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ matrix.target }}-${{ steps.rustc.outputs.commit_hash }}-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/cargo@v1
name: Build the library in debug mode
with:
command: build
args: --all --all-features
- uses: actions-rs/cargo@v1
name: Run the tests
with:
command: test
args: --all --all-features
- uses: actions-rs/cargo@v1
name: Run clippy
with:
command: clippy
args: --all --all-features
if: matrix.clippyetc
- uses: actions-rs/cargo@v1
name: Check formatting
with:
command: fmt
args: --all -- --check
if: matrix.clippyetc
- name: Clear the cargo caches
run: |
cargo install cargo-cache --no-default-features --features ci-autoclean
cargo-cache