From 856cce5c03be03ce2ae811afb6c3af19b3538a64 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 11 Jan 2025 20:04:51 +0000 Subject: [PATCH] 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. --- .forgejo/workflows/test.yml | 2 +- Dockerfile | 10 ++++++---- update.sh | 32 -------------------------------- 3 files changed, 7 insertions(+), 37 deletions(-) delete mode 100755 update.sh diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index d459ae6..3058125 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -10,7 +10,7 @@ jobs: toolchain: - name: stable - name: nightly - - name: v1.81.0 + - name: v1.74.1 steps: - uses: actions/checkout@v4 diff --git a/Dockerfile b/Dockerfile index d7f28aa..fcd27d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 / diff --git a/update.sh b/update.sh deleted file mode 100755 index 957870d..0000000 --- a/update.sh +++ /dev/null @@ -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