rust: add a check-msrv job
This commit is contained in:
parent
191f258813
commit
d1f3655a73
|
@ -6,6 +6,10 @@ on:
|
|||
apt_packages:
|
||||
required: false
|
||||
type: string
|
||||
msrv:
|
||||
required: false
|
||||
type: string
|
||||
default: "1.57.0"
|
||||
secrets:
|
||||
github-token:
|
||||
required: false
|
||||
|
@ -44,6 +48,46 @@ jobs:
|
|||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
check-msrv:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os:
|
||||
- macos-11
|
||||
- ubuntu-20.04
|
||||
- windows-2022
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
- name: Install Rust toolchain (Unix)
|
||||
if: runner.os != 'Windows'
|
||||
shell: bash
|
||||
run:
|
||||
curl https://sh.rustup.rs -sSf | sh -s -- --profile default --default-toolchain ${{ inputs.msrv }} -y
|
||||
|
||||
- name: Install rust toolchain (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
shell: bash
|
||||
run: |
|
||||
curl https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe -o rustup-init.exe
|
||||
./rustup-init --profile default --default-toolchain ${{ inputs.msrv }} -y
|
||||
|
||||
- name: Cache cargo registry and build outputs
|
||||
uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/bin
|
||||
target
|
||||
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }}
|
||||
|
||||
- name: Test compilation
|
||||
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
|
||||
with:
|
||||
command: check
|
||||
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
|
|
Loading…
Reference in New Issue