Skip to content

Factor out native Cargo CI #4

Factor out native Cargo CI

Factor out native Cargo CI #4

Workflow file for this run

---
name: Cargo Native
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions: read-all
jobs:
cargo-native:
strategy:
fail-fast: false
matrix:
os: [windows-2022, ubuntu-22.04, ubuntu-20.04]
toolchain: [stable, beta, nightly]
name: ${{ matrix.os }} / ${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: >- # v4.1.1
actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up Rust toolchain
run: |
rustup update ${{ matrix.toolchain }} \
&& rustup default ${{ matrix.toolchain }}
shell: bash
- name: Set up Cargo cache
uses: >- # v3.3.2
actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-native-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Build on ${{ runner.os }}
run: cargo build --all
- name: Test on ${{ runner.os }}
run: cargo test --all