build: install nightly and v1.74.1 directly in dockerfile
All checks were successful
/ test (map[name:nightly]) (push) Successful in 2m47s
/ test (map[name:stable]) (push) Successful in 3m48s
/ test (map[name:v1.74.1]) (push) Successful in 1m37s

Switching test from 1.81.0 to 1.74.1 to match an MSRV that I actually use.
This commit is contained in:
Paul Campbell 2025-01-11 20:04:51 +00:00
parent 1a5bd83c1e
commit 856cce5c03
3 changed files with 7 additions and 37 deletions

View file

@ -10,7 +10,7 @@ jobs:
toolchain:
- name: stable
- name: nightly
- name: v1.81.0
- name: v1.74.1
steps:
- uses: actions/checkout@v4

View file

@ -27,12 +27,14 @@ RUN cargo binstall -y \
cargo-mutants@25.0 \
release-plz@0.3
COPY update.sh /
# should be a no-op if the FROM line is up-to-date
RUN /update.sh stable
RUN rustup update stable && rustup component add --toolchain stable rustfmt clippy
RUN rustup install nightly && /update.sh nightly
# install nightly
RUN rustup install nightly && rustup component add --toolchain nightly rustfmt clippy
# install v1.74.1
RUN rustup install 1.74.1 && rustup component add --toolchain 1.74.1 rustfmt clippy
COPY entrypoint.sh /

View file

@ -1,32 +0,0 @@
#!/usr/bin/env bash
set -e
echo "INPUT_ARGS: ${INPUT_ARGS}"
# split input into an array
read -ra ARGS <<<"${INPUT_ARGS}"
# default toolchain
TOOLCHAIN="stable"
echo "Default toolchain: ${TOOLCHAIN}"
# if first parameter is 'nightly'...
if test "${ARGS[0]}" == "nightly"; then
TOOLCHAIN="nightly"
ARGS=("${ARGS[@]:1}")
fi
if test "${ARGS[0]}" == "stable"; then
TOOLCHAIN="stable" # redundant as this is the default
ARGS=("${ARGS[@]:1}")
fi
if [[ "${ARGS[0]}" == v1* ]]; then
TOOLCHAIN="${ARGS[0]:1}"
ARGS=("${ARGS[@]:1}")
fi
echo "Selected toolchain: ${TOOLCHAIN}"
echo ">>> Update toolchain"
rustup update "${TOOLCHAIN}"
echo ">>> Install rustfmt and clippy"
rustup component add --toolchain "${TOOLCHAIN}" rustfmt clippy