From 6f60d8f5f102b84822052b80c6e9f4f46cef160b Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Thu, 25 Sep 2025 10:43:12 +0300 Subject: [PATCH] ci: update CI workflows --- .github/workflows/ci.yml | 125 +++++++-------------------------------- 1 file changed, 22 insertions(+), 103 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9c2e29..b70e607 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,112 +9,31 @@ env: RUSTFLAGS: --deny warnings RUSTDOCFLAGS: --deny warnings jobs: - # Run tests - test: - name: Tests + build-and-test: runs-on: ubuntu-latest - timeout-minutes: 30 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - - name: Checkout repository + - name: Checkout code uses: actions/checkout@v4 - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install --no-install-recommends \ - libasound2-dev libudev-dev libwayland-dev \ - libxkbcommon-dev - - name: Populate target directory from cache - uses: Leafwing-Studios/cargo-cache@v2 + - name: Install Rust + uses: actions-rs/toolchain@v1 with: - sweep-cache: true + profile: minimal + toolchain: stable + override: true + - name: Run sccache-cache + uses: mozilla-actions/sccache-actions@0.0.9 - name: Install cargo-nextest - run: cargo install cargo-nextest --locked - - name: Run tests with nextest + uses: taiki-e/install-action@cargo-nextest + - name: Run Clippy + run: cargo clippy --locked --workspace --all-targets --all-features -- -D warnings + - name: Run formatting + run: cargo fmt --all --check + - name: Run Tests run: | - cargo nextest run \ - --all-features \ - --all-targets - # Workaround for https://github.com/rust-lang/cargo/issues/6669 - cargo test \ - --locked \ - --workspace \ - --all-features \ - --doc - # Run clippy lints - clippy: - name: Clippy - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - components: clippy - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install --no-install-recommends \ - libasound2-dev libudev-dev libwayland-dev \ - libxkbcommon-dev - - name: Populate target directory from cache - uses: Leafwing-Studios/cargo-cache@v2 - with: - sweep-cache: true - - name: Run clippy lints - run: | - cargo clippy \ - --locked \ - --workspace \ - --all-features \ - -- \ - --deny warnings - # Check formatting - format: - name: Format - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt - - name: Run cargo fmt - run: | - cargo fmt \ - --all \ - -- \ - --check - # Check documentation - doc: - name: Docs - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install --no-install-recommends \ - libasound2-dev libudev-dev libwayland-dev \ - libxkbcommon-dev - - name: Populate target directory from cache - uses: Leafwing-Studios/cargo-cache@v2 - with: - sweep-cache: true - - name: Check documentation - run: | - cargo doc \ - --locked \ - --workspace \ - --all-features \ - --document-private-items \ - --no-deps + cargo nextest run --all-features --all-targets + cargo test --locked --workspace --all-features --doc + - name: Check Documentation + run: cargo doc --locked --workspace --all-features --document-private-items --no-deps