name: udev
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
rustfmt-clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --tests
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [x86_64]
target: [x86_64-unknown-linux-gnu, i586-unknown-linux-gnu, i686-unknown-linux-gnu]
steps:
- uses: actions/checkout@v3
- name: Setup latest Alpine Linux
uses: jirutka/setup-alpine@v1
with:
arch: ${{ matrix.arch }}
branch: latest-stable
packages: build-base pkgconf lld rustup
- name: Install Rust stable toolchain via rustup
run: rustup-init --target ${{ matrix.target }} --default-toolchain stable --profile minimal -y
shell: alpine.sh {0}
- name: Build (debug)
run: cargo build --target ${{ matrix.target }}
shell: alpine.sh {0}
- name: Build (release)
run: cargo build --release --target ${{ matrix.target }}
shell: alpine.sh {0}
test:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [x86_64]
target: [x86_64-unknown-linux-gnu]
steps:
- uses: actions/checkout@v3
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Run all the tests (debug)
run: cargo test --all --target ${{ matrix.target }}
- name: Run all the tests (release)
run: cargo test --all --release --target ${{ matrix.target }}