Skip to content

Commit

Permalink
Merge pull request #334 from tgross35/ci-cleanup
Browse files Browse the repository at this point in the history
ci: `rustup --no-self-update` and reuqire MSRV checks
  • Loading branch information
tgross35 authored Oct 28, 2024
2 parents 385e41c + 2fde002 commit 3f2db72
Showing 1 changed file with 33 additions and 30 deletions.
63 changes: 33 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,44 +29,19 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update nightly && rustup default nightly
run: rustup update nightly --no-self-update && rustup default nightly
- run: rustup target add ${{ matrix.target }}
- run: rustup target add x86_64-unknown-linux-musl
- run: cargo generate-lockfile
- run: ./ci/run-docker.sh ${{ matrix.target }}

msrv:
name: Check MSRV
runs-on: ubuntu-latest
env:
RUSTFLAGS: # No need to check warnings on old MSRV, unset `-Dwarnings`
steps:
- uses: actions/checkout@master
- run: |
msrv="$(perl -ne 'print if s/rust-version\s*=\s*"(.*)"/\1/g' Cargo.toml)"
echo "MSRV: $msrv"
echo "MSRV=$msrv" >> "$GITHUB_ENV"
- name: Install Rust
run: rustup update "$MSRV" && rustup default "$MSRV"
- run: cargo build -p libm


rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update nightly && rustup default nightly && rustup component add rustfmt
- run: cargo fmt -- --check

wasm:
name: WebAssembly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update nightly && rustup default nightly
run: rustup update nightly --no-self-update && rustup default nightly
- run: rustup target add wasm32-unknown-unknown
- run: cargo build --target wasm32-unknown-unknown

Expand All @@ -76,7 +51,7 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update nightly && rustup default nightly
run: rustup update nightly --no-self-update && rustup default nightly
- run: cargo build -p cb

benchmarks:
Expand All @@ -85,16 +60,44 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update nightly && rustup default nightly
run: rustup update nightly --no-self-update && rustup default nightly
- run: cargo bench --all

msrv:
name: Check MSRV
runs-on: ubuntu-latest
env:
RUSTFLAGS: # No need to check warnings on old MSRV, unset `-Dwarnings`
steps:
- uses: actions/checkout@master
- run: |
msrv="$(perl -ne 'print if s/rust-version\s*=\s*"(.*)"/\1/g' Cargo.toml)"
echo "MSRV: $msrv"
echo "MSRV=$msrv" >> "$GITHUB_ENV"
- name: Install Rust
run: rustup update "$MSRV" --no-self-update && rustup default "$MSRV"
- run: cargo build -p libm

rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: |
rustup update nightly --no-self-update
rustup default nightly
rustup component add rustfmt
- run: cargo fmt -- --check

success:
needs:
- docker
- rustfmt
- wasm
- cb
- benchmarks
- msrv
- rustfmt
runs-on: ubuntu-latest
# GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
Expand Down

0 comments on commit 3f2db72

Please sign in to comment.