Bump dtolnay/rust-toolchain from 315e265cd78dad1e1dcf3a5074f6d6c47029d5aa to a54c7afa936fefeb4456b2dd8068152669aa8203 #778
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
jobs: | |
rustfmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | Checkout | |
uses: actions/[email protected] | |
- name: Setup | Rust | |
uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203 | |
with: | |
toolchain: stable | |
components: rustfmt | |
- name: Run fmt | |
run: cargo fmt --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | Checkout | |
uses: actions/[email protected] | |
- name: Setup | Rust | |
uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203 | |
with: | |
toolchain: stable | |
components: clippy | |
- name: Setup | Cache | |
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 | |
- name: Run clippy | |
run: cargo clippy --locked --tests --all-targets --all-features -- -D clippy::all -W clippy::pedantic | |
test: | |
name: Test | |
permissions: | |
contents: read | |
packages: read | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- aarch64-unknown-linux-gnu | |
- aarch64-unknown-linux-musl | |
- armv7-unknown-linux-gnueabihf | |
- armv7-unknown-linux-musleabihf | |
- x86_64-unknown-linux-musl | |
os: [ubuntu-latest] | |
include: | |
# Use an older Ubuntu version for glibc compatibility with Debian v11 Buster | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-20.04 | |
env: | |
USE_CROSS: "${{ !startsWith(matrix.target, 'x86_64-unknown-linux-') }}" | |
MUSL: ${{ contains(matrix.target, '-unknown-linux-musl') }} | |
CARGO: cargo | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup | Checkout | |
uses: actions/[email protected] | |
- name: Setup | Rust | |
uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203 | |
with: | |
toolchain: stable | |
- name: Setup | Cache | |
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 | |
with: | |
shared-key: ${{ matrix.target }}-${{ matrix.os }}-debug-build | |
- name: Setup | Cross | |
if: env.USE_CROSS == 'true' | |
run: | | |
cargo install --bins cross | |
echo "CARGO=cross" >> $GITHUB_ENV | |
- name: Setup | Install build dependencies | |
if: env.USE_CROSS == 'false' | |
run: | | |
rustup target add ${{ matrix.target }} | |
if [[ "$MUSL" == 'true' ]]; then | |
sudo apt-get update | |
sudo apt-get install --assume-yes musl-tools | |
fi | |
- name: Setup | Log in to the Container registry | |
if: env.USE_CROSS == 'true' | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run check | |
run: ${{ env.CARGO }} check --target ${{ matrix.target }} | |
- name: Run tests | |
# Disable on cross until find a way to use trycmd with it: | |
# https://github.com/assert-rs/trycmd/issues/51 | |
if: env.USE_CROSS == 'false' | |
run: ${{ env.CARGO }} test --verbose --target ${{ matrix.target }} |