some rules #31
This file contains hidden or 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: All Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - name: Install Linux dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| pkg-config \ | |
| libudev-dev \ | |
| libasound2-dev \ | |
| libxkbcommon-dev \ | |
| libwayland-dev \ | |
| libxcb-render0-dev \ | |
| libxcb-shape0-dev \ | |
| libxcb-xfixes0-dev \ | |
| libvulkan-dev \ | |
| libx11-xcb-dev \ | |
| libxcb-dri3-dev \ | |
| libxcb-present-dev \ | |
| mesa-vulkan-drivers \ | |
| xvfb | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@nextest | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Run clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Build | |
| run: cargo build --all-features | |
| - name: Create test directories | |
| run: | | |
| mkdir -p test_assets/visual_references | |
| mkdir -p test_artifacts/visual_diff | |
| mkdir -p test_saves | |
| - name: Run unit tests | |
| run: cargo test --lib -- --nocapture | |
| - name: Run integration tests with Xvfb | |
| run: | | |
| xvfb-run --auto-servernum --server-args="-screen 0 1280x720x24" \ | |
| cargo nextest run --all-features --workspace --exclude-default-features -- \ | |
| --test-threads=1 \ | |
| --no-capture | |
| - name: Run doc tests | |
| run: cargo test --doc | |
| - name: Upload test artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-artifacts | |
| path: | | |
| test_artifacts/ | |
| test_saves/ | |
| retention-days: 5 |