Skip to content

Commit

Permalink
chore(ci): bump rust to 1.76, cargo-chef to 0.1.63 (#744)
Browse files Browse the repository at this point in the history
## Summary
Bump rust to 1.76, cargo-chef to 0.1.63.

## Background
With `cargo-chef:0.1.63` it is no longer necessary to maintain a copy of
Cargo.toml for building images with the `default-members` field removed.
However, the cargo-chef base image is only released for the most recent
version of Rust (1.76 at the time of preparing this PR). To be in sync
with the containerfile we have to bump all github workflows to use Rust
1.76.

## Changes
- Bump the containerfile/dockerfile to use cargo chef 0.1.63
- Remove now unnecessary copying of the shadow Cargo.toml
- Bump the stable Rust version used in github workflows to 1.76
(triggered by cargo-chef only supporting the most recent release of
Rust)
- Bump the nightlies used for formatting and dylint
- Remove the github workflow job testing for the containerfile
Cargo.toml being in sync with the workspace Cargo.toml (and remove the
shadow toml)
- Fix new clippy warnings

## Testing
Unnecessary

## Related Issues
https://github.com/LukeMathWalker/cargo-chef/releases/tag/v0.1.63
LukeMathWalker/cargo-chef#253
  • Loading branch information
SuperFluffy authored Feb 13, 2024
1 parent ea4652b commit 3307520
Show file tree
Hide file tree
Showing 21 changed files with 92 additions and 198 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ jobs:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2023-10-06
toolchain: nightly-2024-02-07
components: rustfmt
- name: run rustfmt
# note: for local development usually `cargo +nightly fmt` is sufficient;
# or `cargo +nightly-2023-08-18 fmt` for specifying the exact release.
run: cargo fmt --all -- --check

toml:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.73.0
- uses: dtolnay/rust-toolchain@1.76.0
- uses: arduino/setup-protoc@v2
with:
version: "24.4"
Expand Down
49 changes: 9 additions & 40 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
version: "1.17.0"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.76.0
- uses: Swatinem/[email protected]
with:
cache-provider: "buildjet"
Expand All @@ -43,44 +43,13 @@ jobs:
exit 1
fi
cargo-toml-synced-with-containerfiles:
runs-on: ubuntu-22.04
needs: run_checker
if: needs.run_checker.outputs.run_tests == 'true'
steps:
- uses: actions/checkout@v3
- name: Download and install dasel
run: |
curl -fsSL \
https://github.com/TomWright/dasel/releases/download/v2.5.0/dasel_linux_amd64.gz \
| gzip -d - \
| install -m 755 /dev/stdin /usr/local/bin/dasel
- name: Download and install taplo
run: |
curl -fsSL \
https://github.com/tamasfe/taplo/releases/download/0.8.1/taplo-full-linux-x86_64.gz \
| gzip -d - \
| install -m 755 /dev/stdin /usr/local/bin/taplo
- name: Install just
uses: taiki-e/install-action@just
- name: Check if containerfiles/Cargo.toml is in sync with Cargo.toml
run: |
just update-containerfiles-cargo-toml
modified=$(git status --porcelain)
if [[ -n $modified ]]; then
echo "ERROR: containerfiles/Cargo.toml is out of sync with workspcae Cargo.toml"
echo "Run locally with \`just update-containerfiles-cargo-toml\` and commit to the repository."
exit 1
fi
compiles:
runs-on: buildjet-4vcpu-ubuntu-2204
needs: run_checker
if: needs.run_checker.outputs.run_tests == 'true'
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.73.0
- uses: dtolnay/rust-toolchain@1.76.0
- uses: taiki-e/[email protected]
with:
tool: [email protected]
Expand All @@ -103,7 +72,7 @@ jobs:
if: needs.run_checker.outputs.run_tests == 'true'
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.73.0
- uses: dtolnay/rust-toolchain@1.76.0
- uses: Swatinem/[email protected]
with:
cache-provider: "github"
Expand All @@ -124,7 +93,7 @@ jobs:
pip3 install solc-select
solc-select install 0.8.15
solc-select use 0.8.15
- uses: dtolnay/rust-toolchain@1.73.0
- uses: dtolnay/rust-toolchain@1.76.0
- uses: Swatinem/[email protected]
with:
cache-provider: "buildjet"
Expand Down Expand Up @@ -155,7 +124,7 @@ jobs:
if: needs.run_checker.outputs.run_tests == 'true'
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.73.0
- uses: dtolnay/rust-toolchain@1.76.0
- uses: Swatinem/[email protected]
with:
cache-provider: "buildjet"
Expand All @@ -172,7 +141,7 @@ jobs:
if: needs.run_checker.outputs.run_tests == 'true' && needs.run_checker.outputs.run_lint_rust == 'true'
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.73.0
- uses: dtolnay/rust-toolchain@1.76.0
with:
components: clippy
- uses: Swatinem/[email protected]
Expand Down Expand Up @@ -201,13 +170,13 @@ jobs:
- uses: dtolnay/rust-toolchain@v1
with:
# This has to match `rust-toolchain` in the rust-toolchain file of the dylint lints
toolchain: nightly-2023-10-06
toolchain: nightly-2023-12-28
components: "clippy, llvm-tools-preview, rustc-dev"
- uses: Swatinem/[email protected]
with:
cache-provider: "buildjet"
- name: install cargo-dylint and dylint-link
run: cargo install cargo-dylint@2.5.0 dylint-link@2.5.0 --locked
run: cargo install cargo-dylint@2.6.1 dylint-link@2.6.1 --locked
- uses: arduino/setup-protoc@v2
with:
version: "24.4"
Expand All @@ -229,7 +198,7 @@ jobs:
test:
if: ${{ always() && !cancelled() }}
needs: [compiles, protos-compiled, rust, doctest, clippy, lockfile, custom-lints, cargo-toml-synced-with-containerfiles]
needs: [compiles, protos-compiled, rust, doctest, clippy, lockfile, custom-lints]
uses: ./.github/workflows/reusable-success.yml
with:
success: ${{ !contains(needs.*.result, 'failure') }}
60 changes: 48 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ markdown.

```sh
# Install rustfmt
rustup +nightly-2023-08-18 component add rustfmt
rustup +nightly-2024-02-07 component add rustfmt
# Run rustfmt
just fmt rust
```
Expand Down
93 changes: 0 additions & 93 deletions containerfiles/Cargo.toml

This file was deleted.

6 changes: 1 addition & 5 deletions containerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# build stage
FROM --platform=$BUILDPLATFORM lukemathwalker/cargo-chef:0.1.62-rust-1.73.0-bookworm AS chef
FROM --platform=$BUILDPLATFORM lukemathwalker/cargo-chef:0.1.63-rust-1.76.0-bookworm AS chef

WORKDIR /build/

Expand Down Expand Up @@ -44,10 +44,6 @@ RUN \
FROM chef AS planner
ARG TARGETBINARY
COPY . .
# XXX: override Cargo.toml in the root with containerfiles/Cargo.toml, which
# does not contain the `default-members` entry. It currently throws off
# cargo chef.
COPY containerfiles/Cargo.toml Cargo.toml
RUN cargo chef prepare --bin crates/$TARGETBINARY --recipe-path recipe.json

FROM chef as builder
Expand Down
Loading

0 comments on commit 3307520

Please sign in to comment.