ci: increase test coverage #329
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: Rust | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main, release-*] | |
pull_request: | |
branches: [main, release-*] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ${{matrix.os}} | |
env: | |
DISPLAY: ':99' | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
headless: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | |
- os: macos-latest | |
extra: -- --skip test_simple | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v2 | |
- if: matrix.os == 'ubuntu-latest' | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: libxtst-dev libevdev-dev libxdo-dev | |
version: 1.0 | |
- name: Add components | |
run: rustup component add clippy rustfmt | |
- name: Setup headless environment | |
run: ${{matrix.headless}} | |
- name: Rustfmt | |
run: | | |
cargo fmt -- --check | |
- name: Clippy | |
run: | | |
cargo clippy --no-default-features --all-targets -- -D warnings | |
cargo clippy --all-targets -- -D warnings | |
cargo clippy --all-features --all-targets -- -D warnings | |
- name: Build | |
run: | | |
cargo build --no-default-features --verbose | |
cargo build --verbose | |
cargo build --all-features --verbose | |
- name: Run tests (minimal features) | |
run: | | |
cargo test --no-default-features --lib --bins --tests --verbose ${{matrix.extra}} | |
- name: Run tests (default features) | |
run: | | |
cargo test --lib --bins --tests --verbose ${{matrix.extra}} | |
- name: Run tests (all features) | |
run: | | |
cargo test --all-features --lib --bins --tests --verbose ${{matrix.extra}} | |
- name: Run benches | |
run: | | |
# TODO for each feature who performance matter |