ci(rust): improve workflow

This commit is contained in:
EdJoPaTo
2021-08-09 08:09:14 +02:00
parent 00bde7473d
commit 8dc7d0d40b
+24 -12
View File
@@ -11,30 +11,42 @@ jobs:
test: test:
name: Test ${{ matrix.os }} ${{ matrix.toolchain }} name: Test ${{ matrix.os }} ${{ matrix.toolchain }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.toolchain == 'nightly' }} continue-on-error: ${{ matrix.experimental }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
# Check stable on the main platforms and ensure there is not even a single warning
- os: ubuntu-latest - os: ubuntu-latest
toolchain: stable toolchain: stable
clippyargs: -D clippy::pedantic -D warnings clippyargs: -D clippy::pedantic -D warnings
experimental: false
- os: macOS-latest - os: macOS-latest
toolchain: stable toolchain: stable
clippyargs: -D clippy::pedantic -D warnings clippyargs: -D clippy::pedantic -D warnings
experimental: false
# Check beta/nightly (potentially buggy) and maybe get some glances on soon to be lints
- os: ubuntu-latest
toolchain: beta
clippyargs: -W clippy::pedantic
experimental: true
- os: ubuntu-latest - os: ubuntu-latest
toolchain: nightly toolchain: nightly
clippyargs: -W clippy::pedantic clippyargs: -W clippy::pedantic
# - os: ubuntu-latest experimental: true
# toolchain: 1.41.1 # Debian 10 Buster
# clippyargs: -W clippy::pedantic -A unknown-lints -A clippy::unknown-clippy-lints # Check if it is still running on older Rust versions.
- os: ubuntu-latest # Sometimes they dont have lint bugfixes which results in false positives -> Dont error, just warn.
toolchain: 1.47.0 # Alpine 3.13 # Also some specified lints are not yet existing in the older rust version -> allow unknown lints.
clippyargs: -W clippy::pedantic -A unknown-lints -A clippy::unknown-clippy-lints
- os: ubuntu-latest - os: ubuntu-latest
toolchain: 1.48.0 # Debian 11 Bullseye toolchain: 1.48.0 # Debian 11 Bullseye
clippyargs: -W clippy::pedantic -A unknown-lints -A clippy::unknown-clippy-lints clippyargs: -A unknown-lints -A clippy::unknown-clippy-lints
experimental: false
- os: ubuntu-latest
toolchain: 1.52.0 # Alpine 3.14
clippyargs: -A unknown-lints
experimental: false
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@@ -58,7 +70,7 @@ jobs:
command: test command: test
args: --verbose --all-features args: --verbose --all-features
release: github-release:
name: Release ${{ matrix.triple }} name: Release ${{ matrix.triple }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
needs: test needs: test
@@ -74,11 +86,11 @@ jobs:
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: macOS-latest - os: macOS-latest
triple: x86_64-apple-darwin triple: x86_64-apple-darwin
- os: macOS-latest - os: macOS-latest
triple: aarch64-apple-darwin triple: aarch64-apple-darwin
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@@ -90,12 +102,12 @@ jobs:
target: ${{ matrix.triple }} target: ${{ matrix.triple }}
toolchain: stable toolchain: stable
- name: Build release - name: Build
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
env: env:
# TODO: Remove this once it's the default # TODO: Remove this once it's the default
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
with: with:
command: build command: build
args: --release --verbose --target ${{ matrix.triple }} args: --release --verbose --all-features --target ${{ matrix.triple }}
use-cross: ${{ runner.os == 'Linux' && matrix.triple != 'x86_64-unknown-linux-gnu' }} use-cross: ${{ runner.os == 'Linux' && matrix.triple != 'x86_64-unknown-linux-gnu' }}