station/.gitea/workflows/test.yml

56 lines
1.3 KiB
YAML

name: Test
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
test:
name: Clippy and tests (nextest)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: |
SUDO=$(command -v sudo || true)
$SUDO apt-get update
$SUDO apt-get install -y --no-install-recommends pkg-config libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: test-${{ hashFiles('Cargo.lock') }}
restore-keys: test-
- name: Clippy
run: cargo clippy --workspace --all-targets --locked -- -D warnings
- name: Test
run: cargo nextest run --workspace --locked --profile ci
- name: Upload test report
if: always()
uses: actions/upload-artifact@v3
with:
name: junit
path: target/nextest/ci/junit.xml