Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): bump rust toolchain to 1.81 #1523

Merged
merged 6 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-02-07
toolchain: nightly-2024-09-15
components: rustfmt
- name: run rustfmt
run: cargo fmt --all -- --check
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:
env:
REGISTRY: ghcr.io
FULL_REF: ${{ inputs.tag && format('refs/tags/{0}', inputs.tag) || github.ref }}
# This must match the entry in rustup-toolchain.toml at the repository root
SuperFluffy marked this conversation as resolved.
Show resolved Hide resolved
RUSTUP_TOOLCHAIN: "1.81.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could name this RUST_TOOLCHAIN to be consistent with the filename?

Also, could we read the appropriate value from the rust-toolchain.toml file here rather than having to keep these in sync?

Copy link
Member Author

@SuperFluffy SuperFluffy Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RUSTUP_TOOLCHAIN is the actual env var that's read by rust: https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file, so I'd like to keep that.

And I guess we could extract this, but I didn't want to move away from dtolnay/rust-toolchain (at least for now), and parsing toml files in workflows can only be done through obscure github actions, which I didn't feel comfortable introducing.

Followup?


jobs:
upload-binaries:
Expand All @@ -34,7 +36,9 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- uses: dtolnay/rust-toolchain@1.76.0
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUSTUP_TOOLCHAIN }}
- uses: arduino/setup-protoc@v3
with:
version: "24.4"
Expand Down
58 changes: 39 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Test
env:
CI: true
RUSTFLAGS: "-D warnings -D unreachable-pub --cfg tokio_unstable"

# This must match the entry in rustup-toolchain.toml at the repository root
RUSTUP_TOOLCHAIN: "1.81.0"
SuperFluffy marked this conversation as resolved.
Show resolved Hide resolved
on:
pull_request:
merge_group:
Expand All @@ -26,7 +29,9 @@ jobs:
version: "1.32.0"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.76.0
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUSTUP_TOOLCHAIN }}
- uses: Swatinem/rust-cache@v2.7.3
with:
cache-provider: "buildjet"
Expand All @@ -51,7 +56,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.76.0
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUSTUP_TOOLCHAIN }}
- uses: Swatinem/rust-cache@v2.7.3
with:
cache-provider: "buildjet"
Expand All @@ -77,7 +84,9 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: dtolnay/rust-toolchain@1.76.0
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUSTUP_TOOLCHAIN }}
- uses: taiki-e/install-action@v2.15.2
with:
tool: cargo-hack@0.5.29
Expand All @@ -100,7 +109,9 @@ jobs:
if: needs.run_checker.outputs.run_tests == 'true'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.76.0
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUSTUP_TOOLCHAIN }}
- uses: Swatinem/rust-cache@v2.7.3
with:
cache-provider: "github"
Expand All @@ -113,7 +124,9 @@ jobs:
if: needs.run_checker.outputs.run_audit == 'true'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.76.0
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUSTUP_TOOLCHAIN }}
- uses: rustsec/audit-check@v1.4.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -126,7 +139,9 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: dtolnay/rust-toolchain@1.76.0
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUSTUP_TOOLCHAIN }}
- uses: Swatinem/rust-cache@v2.7.3
with:
cache-provider: "buildjet"
Expand Down Expand Up @@ -154,7 +169,9 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: dtolnay/rust-toolchain@1.76.0
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUSTUP_TOOLCHAIN }}
- uses: Swatinem/rust-cache@v2.7.3
with:
cache-provider: "buildjet"
Expand All @@ -179,7 +196,9 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: dtolnay/rust-toolchain@1.76.0
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUSTUP_TOOLCHAIN }}
- uses: Swatinem/rust-cache@v2.7.3
with:
cache-provider: "buildjet"
Expand All @@ -198,8 +217,9 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: dtolnay/rust-toolchain@1.78.0
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUSTUP_TOOLCHAIN }}
components: clippy
- uses: Swatinem/rust-cache@v2.7.3
with:
Expand All @@ -226,26 +246,26 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: dtolnay/rust-toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
# This has to match `rust-toolchain` in the rust-toolchain file of the dylint lints
toolchain: nightly-2023-12-28
components: "clippy, llvm-tools-preview, rustc-dev"
toolchain: nightly-2024-09-05
components: "clippy, llvm-tools-preview, rustc-dev, rust-src"
- uses: Swatinem/rust-cache@v2.7.3
with:
cache-provider: "buildjet"
- name: install cargo-dylint and dylint-link
run: cargo install cargo-dylint@2.6.1 dylint-link@2.6.1 --locked
run: cargo install cargo-dylint@3.2.0 dylint-link@3.2.0 --locked
- uses: arduino/setup-protoc@v3
with:
version: "24.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: run clippy against custom lints
run: |
: # list all lint packages here to have clippy explicitly test them
cargo clippy --all-targets --all-features \
-p tracing_debug_field \
-- --warn clippy::pedantic --deny warnings
# - name: run clippy against custom lints
# run: |
# : # list all lint packages here to have clippy explicitly test them
# cargo clippy --all-targets --all-features \
# -p tracing_debug_field \
# -- --warn clippy::pedantic --deny warnings
- name: run dylint clippy on workspace crates
env:
# set the dylint driver path to the target/ directory so that it's hopefully cached by rust-cache
Expand Down
Loading
Loading