ci: lock cross to 0.2.1 on CI as well (#756)

Locks CI to cross 0.2.1.
This commit is contained in:
Clement Tsang 2022-06-25 23:03:14 -04:00 committed by GitHub
parent 89f7705e21
commit 6468f8af58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 15 deletions

View File

@ -27,11 +27,11 @@ env:
jobs: jobs:
# Runs rustfmt + tests + clippy on the main supported platforms. # Runs rustfmt + tests + clippy on the main supported platforms.
supported: supported:
runs-on: ${{ matrix.triple.os }} runs-on: ${{ matrix.info.os }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
triple: info:
- { - {
os: "ubuntu-latest", os: "ubuntu-latest",
target: "x86_64-unknown-linux-gnu", target: "x86_64-unknown-linux-gnu",
@ -74,7 +74,7 @@ jobs:
with: with:
toolchain: stable toolchain: stable
components: rustfmt, clippy components: rustfmt, clippy
target: ${{ matrix.triple.target }} target: ${{ matrix.info.target }}
- name: Enable Rust cache - name: Enable Rust cache
if: ${{ steps.skip_check.outputs.should_skip != 'true' }} if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
@ -84,13 +84,18 @@ jobs:
if: ${{ steps.skip_check.outputs.should_skip != 'true' }} if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
run: cargo fmt --all -- --check run: cargo fmt --all -- --check
- name: Install cross if needed
if: matrix.info.cross == true
run: |
cargo install cross --locked --version=0.2.1
- name: Build tests - name: Build tests
if: ${{ steps.skip_check.outputs.should_skip != 'true' }} if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: test command: test
args: --no-run --locked ${{ matrix.features }} args: --no-run --locked ${{ matrix.features }}
use-cross: ${{ matrix.triple.cross }} use-cross: ${{ matrix.info.cross }}
env: env:
RUST_BACKTRACE: full RUST_BACKTRACE: full
@ -100,7 +105,7 @@ jobs:
with: with:
command: test command: test
args: --no-fail-fast ${{ matrix.features }} -- --nocapture --quiet args: --no-fail-fast ${{ matrix.features }} -- --nocapture --quiet
use-cross: ${{ matrix.triple.cross }} use-cross: ${{ matrix.info.cross }}
env: env:
RUST_BACKTRACE: full RUST_BACKTRACE: full
@ -110,18 +115,18 @@ jobs:
with: with:
command: clippy command: clippy
args: ${{ matrix.features }} --all-targets --workspace -- -D warnings args: ${{ matrix.features }} --all-targets --workspace -- -D warnings
use-cross: ${{ matrix.triple.cross }} use-cross: ${{ matrix.info.cross }}
env: env:
RUST_BACKTRACE: full RUST_BACKTRACE: full
# Run cargo check on all other platforms # Run cargo check on all other platforms
other_check: other_check:
runs-on: ${{ matrix.triple.os }} runs-on: ${{ matrix.info.os }}
continue-on-error: true continue-on-error: true
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
triple: info:
# x86 or x64 # x86 or x64
- { - {
os: "ubuntu-latest", os: "ubuntu-latest",
@ -232,19 +237,24 @@ jobs:
if: ${{ steps.skip_check.outputs.should_skip != 'true' }} if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
uses: dtolnay/rust-toolchain@88e7c2e1da2693cf72d58fce9416206818e61dea # https://github.com/dtolnay/rust-toolchain/commit/88e7c2e1da2693cf72d58fce9416206818e61dea uses: dtolnay/rust-toolchain@88e7c2e1da2693cf72d58fce9416206818e61dea # https://github.com/dtolnay/rust-toolchain/commit/88e7c2e1da2693cf72d58fce9416206818e61dea
with: with:
toolchain: ${{ matrix.triple.rust }} toolchain: ${{ matrix.info.rust }}
target: ${{ matrix.triple.target }} target: ${{ matrix.info.target }}
- name: Enable Rust cache - name: Enable Rust cache
uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c # 1.4.0 uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c # 1.4.0
if: ${{ steps.skip_check.outputs.should_skip != 'true' }} if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
with: with:
key: ${{ matrix.triple.target }} key: ${{ matrix.info.target }}
- name: Install cross if needed
if: matrix.info.cross == true
run: |
cargo install cross --locked --version=0.2.1
- name: Check - name: Check
if: ${{ steps.skip_check.outputs.should_skip != 'true' }} if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: check command: check
args: --all-targets --verbose --target=${{ matrix.triple.target }} --locked args: --all-targets --verbose --target=${{ matrix.info.target }} --locked
use-cross: ${{ matrix.triple.cross }} use-cross: ${{ matrix.info.cross }}

View File

@ -41,8 +41,6 @@ jobs:
- name: Enable Rust cache - name: Enable Rust cache
uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c # 1.4.0 uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c # 1.4.0
with:
key: ${{ matrix.triple.target }}
- name: Install cargo-llvm-cov - name: Install cargo-llvm-cov
run: | run: |