Skip to content

Commit

Permalink
Auto merge of #242 - troy/pin-nightly, r=TroyKomodo
Browse files Browse the repository at this point in the history
revert nightly to older build
the latest nightly broke on coverage checking so we pin it back to continue working. We will unpin it after nightly has been fixed.

Requested-by: TroyKomodo <[email protected]>
  • Loading branch information
scuffle-brawl[bot] authored Jan 9, 2025
2 parents 87971c7 + 064744c commit 53cf19c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 28 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
RUST_TOOLCHAIN: nightly-2025-01-06

jobs:
clippy:
name: Clippy
Expand All @@ -26,7 +29,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
id: setup-rust
with:
toolchain: nightly
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: clippy

- uses: Swatinem/rust-cache@v2
Expand All @@ -36,7 +39,7 @@ jobs:
shared-key: clippy

- name: Make sure code is linted
run: cargo +nightly clippy
run: cargo +${{ env.RUST_TOOLCHAIN }} clippy

fmt:
name: Fmt
Expand All @@ -49,11 +52,11 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
id: setup-rust
with:
toolchain: nightly
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: rustfmt

- name: Make sure code is formatted
run: cargo +nightly fmt --check
run: cargo +${{ env.RUST_TOOLCHAIN }} fmt --check

hakari:
name: Hakari
Expand All @@ -64,7 +67,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
id: setup-rust
with:
toolchain: nightly
toolchain: ${{ env.RUST_TOOLCHAIN }}

- uses: taiki-e/install-action@v2
with:
Expand All @@ -74,9 +77,9 @@ jobs:
run: |
set -xeo pipefail
cargo hakari manage-deps --dry-run
cargo hakari generate --diff
cargo hakari verify
cargo +${{ env.RUST_TOOLCHAIN }} hakari manage-deps --dry-run
cargo +${{ env.RUST_TOOLCHAIN }} hakari generate --diff
cargo +${{ env.RUST_TOOLCHAIN }} hakari verify
test:
name: Test
Expand All @@ -91,7 +94,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
id: setup-rust
with:
toolchain: nightly
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: llvm-tools-preview

- name: Install ffmpeg
Expand Down Expand Up @@ -128,9 +131,9 @@ jobs:
# Once it fully works we can add the `--doctests` flag to the test and report command again.
- name: Run tests
run: |
cargo +nightly llvm-cov nextest --no-fail-fast --all-features --profile ci --no-report
cargo +nightly llvm-cov test --all-features --doc --no-report
cargo +nightly llvm-cov report --lcov --output-path ./lcov.info
cargo +${{ env.RUST_TOOLCHAIN }} llvm-cov nextest --no-fail-fast --all-features --profile ci --no-report
cargo +${{ env.RUST_TOOLCHAIN }} llvm-cov test --all-features --doc --no-report
cargo +${{ env.RUST_TOOLCHAIN }} llvm-cov report --lcov --output-path ./lcov.info
- name: Codecov Override
if: ${{ startsWith(github.ref, 'refs/heads/automation/brawl/try/') }}
Expand Down
32 changes: 16 additions & 16 deletions Justfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
mod? local

# An alias for cargo +nightly xtask check
# By default we use the nightly toolchain, however you can override this by setting the RUST_TOOLCHAIN environment variable.
export RUST_TOOLCHAIN := env_var_or_default('RUST_TOOLCHAIN', 'nightly')

# An alias for cargo xtask check
powerset *args:
cargo +nightly xtask powerset {{args}}
cargo +{{RUST_TOOLCHAIN}} xtask powerset {{args}}

# An alias for cargo +nightly fmt --all
# An alias for cargo fmt --all
fmt *args:
cargo +nightly fmt --all {{args}}
cargo +{{RUST_TOOLCHAIN}} fmt --all {{args}}

lint *args:
cargo +nightly clippy --fix --allow-dirty --all-targets --allow-staged {{args}}
cargo +{{RUST_TOOLCHAIN}} clippy --fix --allow-dirty --all-targets --allow-staged {{args}}

test *args:
#!/bin/bash
set -euo pipefail

# We use the nightly toolchain for coverage since it supports branch & no-coverage flags.
export RUSTUP_TOOLCHAIN=nightly

INSTA_FORCE_PASS=1 cargo llvm-cov clean --workspace
INSTA_FORCE_PASS=1 cargo llvm-cov nextest --include-build-script --no-report -- {{args}}
INSTA_FORCE_PASS=1 cargo +{{RUST_TOOLCHAIN}} llvm-cov clean --workspace
INSTA_FORCE_PASS=1 cargo +{{RUST_TOOLCHAIN}} llvm-cov nextest --include-build-script --no-report -- {{args}}
# Coverage for doctests is currently broken in llvm-cov.
# Once it fully works we can add the `--doctests` flag to the test and report command again.
cargo llvm-cov test --doc --no-report -- {{args}}
cargo +{{RUST_TOOLCHAIN}} llvm-cov test --doc --no-report -- {{args}}

# Do not generate the coverage report on CI
cargo insta review
cargo llvm-cov report --lcov --output-path ./lcov.info
cargo llvm-cov report --html
cargo +{{RUST_TOOLCHAIN}} llvm-cov report --lcov --output-path ./lcov.info
cargo +{{RUST_TOOLCHAIN}} llvm-cov report --html

deny *args:
cargo deny {{args}} --all-features check
cargo +{{RUST_TOOLCHAIN}} deny {{args}} --all-features check

workspace-hack:
cargo hakari manage-deps
cargo hakari generate
cargo +{{RUST_TOOLCHAIN}} hakari manage-deps
cargo +{{RUST_TOOLCHAIN}} hakari generate

0 comments on commit 53cf19c

Please sign in to comment.