1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
---
name: Rust
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
# Minimum supported Rust version (MSRV)
ACTION_MSRV_TOOLCHAIN: 1.46.0
# Pinned toolchain for linting
ACTION_LINTS_TOOLCHAIN: 1.55.0
jobs:
tests-stable:
name: "Tests, stable toolchain"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: "stable"
default: true
- name: cargo build
run: cargo build
- name: cargo test
run: cargo test
- name: cargo build (release)
run: cargo build --release
tests-minimum-toolchain:
name: "Tests, minimum supported toolchain (MSRV)"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env['ACTION_MSRV_TOOLCHAIN'] }}
default: true
- name: cargo test (release)
run: cargo test --release
linting:
name: "Lints, pinned toolchain"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env['ACTION_LINTS_TOOLCHAIN'] }}
default: true
components: rustfmt, clippy
- name: cargo clippy (warnings)
run: cargo clippy -- -D warnings
- name: cargo fmt (check)
run: cargo fmt -- --check -l
tests-other-channels:
name: "Tests, unstable toolchain"
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
channel:
- "beta"
- "nightly"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.channel }}
default: true
- name: cargo build
run: cargo build
- name: cargo test
run: cargo test
|