From dd456a99bae33d00010fd250f8743f98fb22814b Mon Sep 17 00:00:00 2001 From: Ben Frankel Date: Fri, 12 Jul 2024 11:18:29 -0700 Subject: [PATCH 1/9] Improve CI some more --- .github/workflows/ci.yaml | 74 ++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 387d1013..57c1116a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,24 +12,45 @@ env: jobs: # Run unit tests. test: - name: Test Suite + name: Unit Tests runs-on: ubuntu-latest timeout-minutes: 30 steps: - - name: Checkout sources + - name: Checkout repository uses: actions/checkout@v4 - - name: Install stable toolchain + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable - - name: Cache target directory + - name: Install dependencies + run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev + + - name: Populate target directory from cache uses: Leafwing-Studios/cargo-cache@v1 - - name: Install Dependencies + - name: Run unit tests + run: cargo test --workspace --all-targets --all-features + + # Run doc tests. + test: + name: Doc Tests + 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 + - name: Populate target directory from cache + uses: Leafwing-Studios/cargo-cache@v1 + - name: Run cargo test - run: cargo test --all-targets + run: cargo test --workspace --doc --all-features # Run clippy lints. clippy_check: @@ -37,60 +58,57 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - name: Checkout sources + - name: Checkout repository uses: actions/checkout@v4 - - name: Install stable toolchain + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: components: clippy - - name: Cache target directory - uses: Leafwing-Studios/cargo-cache@v1 - - - name: Install Dependencies + - name: Install dependencies run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev + - name: Populate target directory from cache + uses: Leafwing-Studios/cargo-cache@v1 + - name: Run clippy - run: cargo clippy --all-targets -- -D warnings + run: cargo clippy --workspace --all-targets --all-features -- --deny warnings - # Run cargo fmt --all -- --check + # Check formatting. format: name: Format runs-on: ubuntu-latest timeout-minutes: 30 steps: - - name: Checkout sources + - name: Checkout repository uses: actions/checkout@v4 - - name: Install stable toolchain + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: components: rustfmt - - name: Cache target directory - uses: Leafwing-Studios/cargo-cache@v1 - - name: Run cargo fmt run: cargo fmt --all -- --check # Check documentation. doc: - name: Doc + name: Docs runs-on: ubuntu-latest timeout-minutes: 30 steps: - - name: Checkout sources + - name: Checkout repository uses: actions/checkout@v4 - - name: Install stable toolchain + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable - - name: Cache target directory - uses: Leafwing-Studios/cargo-cache@v1 - - - name: Install Dependencies + - name: Install dependencies run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev - - name: Run cargo doc - run: cargo doc --no-deps + - name: Populate target directory from cache + uses: Leafwing-Studios/cargo-cache@v1 + + - name: Check documentation + run: cargo doc --workspace --all-features From 4b8fb69db734bf19320fa6cb1176b34ef233eef3 Mon Sep 17 00:00:00 2001 From: Ben Frankel Date: Fri, 12 Jul 2024 11:20:11 -0700 Subject: [PATCH 2/9] .. lints --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 57c1116a..96f45b36 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -72,7 +72,7 @@ jobs: - name: Populate target directory from cache uses: Leafwing-Studios/cargo-cache@v1 - - name: Run clippy + - name: Run clippy lints run: cargo clippy --workspace --all-targets --all-features -- --deny warnings # Check formatting. From 30905f7cf4e7b960de57d39d145d0da4df13c81e Mon Sep 17 00:00:00 2001 From: Ben Frankel Date: Fri, 12 Jul 2024 11:22:45 -0700 Subject: [PATCH 3/9] Fix two jobs with the same name --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 96f45b36..7bec9d8e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,7 +11,7 @@ env: jobs: # Run unit tests. - test: + unit-test: name: Unit Tests runs-on: ubuntu-latest timeout-minutes: 30 @@ -32,7 +32,7 @@ jobs: run: cargo test --workspace --all-targets --all-features # Run doc tests. - test: + doc-test: name: Doc Tests runs-on: ubuntu-latest timeout-minutes: 30 From 74f80bb1fb330b0ded082532ce8916e5bbb64d77 Mon Sep 17 00:00:00 2001 From: Ben Frankel Date: Fri, 12 Jul 2024 11:49:27 -0700 Subject: [PATCH 4/9] Test all targets fr this time --- .github/workflows/ci.yaml | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7bec9d8e..36887371 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,9 +10,9 @@ env: CARGO_TERM_COLOR: always jobs: - # Run unit tests. - unit-test: - name: Unit Tests + # Run tests. + test: + name: Tests runs-on: ubuntu-latest timeout-minutes: 30 steps: @@ -28,29 +28,11 @@ jobs: - name: Populate target directory from cache uses: Leafwing-Studios/cargo-cache@v1 - - name: Run unit tests - run: cargo test --workspace --all-targets --all-features - - # Run doc tests. - doc-test: - name: Doc Tests - 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 - - - name: Populate target directory from cache - uses: Leafwing-Studios/cargo-cache@v1 - - - name: Run cargo test - run: cargo test --workspace --doc --all-features + - name: Run tests + run: | + cargo test --workspace --all-targets --all-features + # TODO: Workaround for https://github.com/rust-lang/cargo/issues/6669 + cargo test --workspace --docs --all-features # Run clippy lints. clippy_check: From e769afdda54fdecc77c63bf4feac7f750c6fbc49 Mon Sep 17 00:00:00 2001 From: Ben Frankel Date: Fri, 12 Jul 2024 11:51:56 -0700 Subject: [PATCH 5/9] Update .github/workflows/ci.yaml Co-authored-by: Jan Hohenheim --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 36887371..1e61ccee 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,8 +31,8 @@ jobs: - name: Run tests run: | cargo test --workspace --all-targets --all-features - # TODO: Workaround for https://github.com/rust-lang/cargo/issues/6669 - cargo test --workspace --docs --all-features + # Workaround for https://github.com/rust-lang/cargo/issues/6669 + cargo test --workspace --docs # Run clippy lints. clippy_check: From 84aab4e1a81b2ec7a163dc381c01867fcd5c7059 Mon Sep 17 00:00:00 2001 From: Ben Frankel Date: Fri, 12 Jul 2024 11:54:12 -0700 Subject: [PATCH 6/9] Update .github/workflows/ci.yaml Co-authored-by: Jan Hohenheim --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1e61ccee..2ecae986 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,7 +32,7 @@ jobs: run: | cargo test --workspace --all-targets --all-features # Workaround for https://github.com/rust-lang/cargo/issues/6669 - cargo test --workspace --docs + cargo test --workspace --doc # Run clippy lints. clippy_check: From 566807852562a5e1253891bddf43d641c03c6aa6 Mon Sep 17 00:00:00 2001 From: Ben Frankel Date: Fri, 12 Jul 2024 11:56:19 -0700 Subject: [PATCH 7/9] Update .github/workflows/ci.yaml Co-authored-by: Jan Hohenheim --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2ecae986..0d628c6b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -93,4 +93,4 @@ jobs: uses: Leafwing-Studios/cargo-cache@v1 - name: Check documentation - run: cargo doc --workspace --all-features + run: cargo doc --workspace --all-features --document-private-items From 8c7a3d539f97ca2488008585cdc299741b476b6f Mon Sep 17 00:00:00 2001 From: Ben Frankel Date: Fri, 12 Jul 2024 12:08:46 -0700 Subject: [PATCH 8/9] Update .github/workflows/ci.yaml Co-authored-by: Jan Hohenheim --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0d628c6b..d76e054f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -93,4 +93,4 @@ jobs: uses: Leafwing-Studios/cargo-cache@v1 - name: Check documentation - run: cargo doc --workspace --all-features --document-private-items + run: cargo doc --workspace --all-features --document-private-items --no-deps From ea030a5b1bc6eaab4d6409232b014eeff2cb7d77 Mon Sep 17 00:00:00 2001 From: Ben Frankel Date: Fri, 12 Jul 2024 12:15:41 -0700 Subject: [PATCH 9/9] Deny warnings --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d76e054f..5ff08974 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,6 +8,8 @@ on: env: CARGO_TERM_COLOR: always + RUSTFLAGS: --deny warnings + RUSTDOCFLAGS: --deny warnings jobs: # Run tests.