Unify CI jobs and replace unmaintend actions-rs. #72
Workflow file for this run
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
name: CI | |
on: | |
push: { branches: "main" } | |
pull_request: { branches: "*" } | |
jobs: | |
build_and_test: | |
name: Build and test with ${{ matrix.rust }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
rust: [stable, nightly, 1.65.0] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Restore cached crates.io index | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
key: ${{ runner.os }}-rust-${{ matrix.rust }} | |
- name: Checkout code | |
uses: actions/checkout@master | |
- name: Install Rust ${{ matrix.rust }} | |
run: | | |
rustup install ${{ matrix.rust }} --profile minimal | |
rustup default ${{ matrix.rust }} | |
rustup components add clippy | |
- name: Build | |
run: cargo build --release --all-features --color=always | |
- name: Test | |
run: cargo test --release --all-features --color=always |