build: install nightly and v1.74.1 directly in dockerfile
Switching test from 1.81.0 to 1.74.1 to match an MSRV that I actually use.
This commit is contained in:
parent
1a5bd83c1e
commit
856cce5c03
3 changed files with 7 additions and 37 deletions
|
@ -10,7 +10,7 @@ jobs:
|
||||||
toolchain:
|
toolchain:
|
||||||
- name: stable
|
- name: stable
|
||||||
- name: nightly
|
- name: nightly
|
||||||
- name: v1.81.0
|
- name: v1.74.1
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
10
Dockerfile
10
Dockerfile
|
@ -27,12 +27,14 @@ RUN cargo binstall -y \
|
||||||
cargo-mutants@25.0 \
|
cargo-mutants@25.0 \
|
||||||
release-plz@0.3
|
release-plz@0.3
|
||||||
|
|
||||||
COPY update.sh /
|
|
||||||
|
|
||||||
# should be a no-op if the FROM line is up-to-date
|
# 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 /
|
COPY entrypoint.sh /
|
||||||
|
|
||||||
|
|
32
update.sh
32
update.sh
|
@ -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
|
|
Loading…
Add table
Reference in a new issue