Files
managarr-tree-widget/.github/workflows/rust.yml
2021-08-09 08:09:14 +02:00

114 lines
3.5 KiB
YAML

name: Test and Build Rust
on:
push:
pull_request:
schedule:
# Check if it works with current dependencies (weekly on Wednesday 2:32 UTC)
- cron: '32 2 * * 3'
jobs:
test:
name: Test ${{ matrix.os }} ${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
include:
# Check stable on the main platforms and ensure there is not even a single warning
- os: ubuntu-latest
toolchain: stable
clippyargs: -D clippy::pedantic -D warnings
experimental: false
- os: macOS-latest
toolchain: stable
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
toolchain: nightly
clippyargs: -W clippy::pedantic
experimental: true
# Check if it is still running on older Rust versions.
# Sometimes they dont have lint bugfixes which results in false positives -> Dont error, just warn.
# Also some specified lints are not yet existing in the older rust version -> allow unknown lints.
- os: ubuntu-latest
toolchain: 1.48.0 # Debian 11 Bullseye
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:
- uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
components: clippy
override: true
profile: minimal
toolchain: ${{ matrix.toolchain }}
- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --verbose --all-targets --all-features -- ${{ matrix.clippyargs }}
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all-features
github-release:
name: Release ${{ matrix.triple }}
runs-on: ${{ matrix.os }}
needs: test
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
triple: x86_64-unknown-linux-gnu
- os: ubuntu-latest
triple: arm-unknown-linux-gnueabihf
- os: ubuntu-latest
triple: armv7-unknown-linux-gnueabihf
- os: ubuntu-latest
triple: aarch64-unknown-linux-gnu
- os: macOS-latest
triple: x86_64-apple-darwin
- os: macOS-latest
triple: aarch64-apple-darwin
steps:
- uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
override: true
profile: minimal
target: ${{ matrix.triple }}
toolchain: stable
- name: Build
uses: actions-rs/cargo@v1
env:
# TODO: Remove this once it's the default
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
with:
command: build
args: --release --verbose --all-features --target ${{ matrix.triple }}
use-cross: ${{ runner.os == 'Linux' && matrix.triple != 'x86_64-unknown-linux-gnu' }}