ci(rust): improve workflow

This commit is contained in:
EdJoPaTo
2022-01-19 14:27:03 +01:00
parent 6b91f900e2
commit 2421ba4a89
+25 -34
View File
@@ -9,43 +9,37 @@ on:
jobs: jobs:
test: test:
name: Test ${{ matrix.os }} ${{ matrix.toolchain }} name: Test ${{ matrix.toolchain }} ${{ matrix.os }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.toolchain == 'nightly' }} continue-on-error: ${{ matrix.toolchain == 'nightly' }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os:
- ubuntu-latest
- macos-latest
toolchain: toolchain:
- stable - stable
os:
- ubuntu-latest
- macos-11
clippyargs: clippyargs:
- -D clippy::pedantic -D warnings - -D clippy::pedantic -D warnings
features: features:
- --all-features - --all-features
include: include:
# Check future versions and maybe get some glances on soon to be lints # Check future versions and maybe get some glances on soon to be lints
- os: ubuntu-latest - toolchain: beta
toolchain: beta os: ubuntu-latest
features: --all-features
clippyargs: -W clippy::pedantic -W clippy::nursery -W clippy::cargo clippyargs: -W clippy::pedantic -W clippy::nursery -W clippy::cargo
- toolchain: nightly
os: ubuntu-latest
features: --all-features features: --all-features
- os: ubuntu-latest
toolchain: nightly
clippyargs: -W clippy::pedantic clippyargs: -W clippy::pedantic
features: --all-features
# Check if it is still running on older Rust versions. # Check the minimum supported Rust version (MSRV).
# Sometimes they dont have lint bugfixes which results in false positives -> Dont error, just warn. # Sometimes old rust versions don't yet have the lints (allow unknown) or don't have fixes in lints (false positives -> don't error, just warn).
# Also some specified lints are not yet existing in the older rust version -> allow unknown lints. # When a certain distro is a target look up its version: https://repology.org/project/rust/versions
# https://packages.debian.org/search?keywords=rustc
# https://pkgs.alpinelinux.org/packages?name=rust
- os: ubuntu-latest - os: ubuntu-latest
toolchain: 1.48.0 # Debian 11 Bullseye toolchain: 1.48.0
clippyargs: -A unknown-lints -A clippy::unknown-clippy-lints
features: --all-features
- os: ubuntu-latest
toolchain: 1.52.1 # Alpine 3.14
clippyargs: -A unknown-lints clippyargs: -A unknown-lints
features: --all-features features: --all-features
steps: steps:
@@ -85,19 +79,19 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - triple: x86_64-unknown-linux-gnu
triple: x86_64-unknown-linux-gnu os: ubuntu-latest
- os: ubuntu-latest - triple: arm-unknown-linux-gnueabihf
triple: arm-unknown-linux-gnueabihf os: ubuntu-latest
- os: ubuntu-latest - triple: armv7-unknown-linux-gnueabihf
triple: armv7-unknown-linux-gnueabihf os: ubuntu-latest
- os: ubuntu-latest - triple: aarch64-unknown-linux-gnu
triple: aarch64-unknown-linux-gnu os: ubuntu-latest
- os: macos-latest - triple: x86_64-apple-darwin
triple: x86_64-apple-darwin os: macos-11
- os: macos-latest - triple: aarch64-apple-darwin
triple: aarch64-apple-darwin os: macos-11
steps: steps:
- name: Setup Rust - name: Setup Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
@@ -111,9 +105,6 @@ jobs:
- name: Build - name: Build
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
env:
# TODO: Remove this once macos-11 is macos-latest
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
with: with:
command: build command: build
args: --release --verbose --all-features --target ${{ matrix.triple }} args: --release --verbose --all-features --target ${{ matrix.triple }}