feat: drop entrypoint in favour of using 'run' over 'uses'
All checks were successful
/ test (map[name:stable]) (push) Successful in 4s
/ test (map[name:1.74.1]) (push) Successful in 3s
/ test (map[name:nightly]) (push) Successful in 4s

This commit is contained in:
Paul Campbell 2025-01-12 11:18:19 +00:00 committed by Paul Campbell
parent cb915104cb
commit da790827d4
3 changed files with 14 additions and 70 deletions

View file

@ -5,42 +5,33 @@ on:
jobs:
test:
runs-on: docker
container:
image:
git.kemitix.net/kemitix/rust:v3.0.0-rc2
strategy:
matrix:
toolchain:
- name: stable
- name: nightly
- name: v1.74.1
- name: 1.74.1
steps:
- uses: actions/checkout@v4
- name: Machete
uses: https://git.kemitix.net/kemitix/rust@v2.6.0-rc3
with:
args: cargo machete
run: cargo machete
- name: Format
uses: https://git.kemitix.net/kemitix/rust@v2.6.0-rc3
with:
args: ${{ matrix.toolchain.name }} cargo fmt --check
run: cargo +${{ matrix.toolchain.name }} fmt --check
- name: Clippy
uses: https://git.kemitix.net/kemitix/rust@v2.6.0-rc3
with:
args: ${{ matrix.toolchain.name }} cargo clippy
run: cargo +${{ matrix.toolchain.name }} clippy
- name: Test
uses: https://git.kemitix.net/kemitix/rust@v2.6.0-rc3
with:
args: ${{ matrix.toolchain.name }} cargo test
run: cargo +${{ matrix.toolchain.name }} test
- name: Build
uses: https://git.kemitix.net/kemitix/rust@v2.6.0-rc3
with:
args: ${{ matrix.toolchain.name }} cargo build
run: cargo +${{ matrix.toolchain.name }} build
- name: Run
uses: https://git.kemitix.net/kemitix/rust@v2.6.0-rc3
with:
args: ${{ matrix.toolchain.name }} cargo run
run: cargo +${{ matrix.toolchain.name }} run

View file

@ -27,18 +27,16 @@ RUN cargo binstall -y \
cargo-mutants@25.0 \
release-plz@0.3
# install v1.74.1
RUN rustup install 1.74.1 && rustup component add --toolchain 1.74.1 rustfmt clippy
# should be a no-op if the FROM line is up-to-date
RUN rustup update stable && rustup component add --toolchain stable rustfmt clippy
# 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 /
RUN git config --global user.email "action@git.kemitix.net" && \
git config --global user.name "ForgeJo Action. See: https://git.kemitix.net/kemitix/rust"
ENTRYPOINT [ "/entrypoint.sh" ]
WORKDIR /app

View file

@ -1,45 +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}"
if test "${ARGS[0]}" == "cargo";then
PRE_COMMAND="cargo +${TOOLCHAIN} "
else
PRE_COMMAND="${ARGS[0]}"
fi
ARGS=("${ARGS[@]:1}")
# ensure toolchain is up-to-date
# recombine remaining arguments
COMMAND=$(
IFS=" "
echo "${ARGS[*]}"
)
# execute command
echo ">>> ${PRE_COMMAND} ${COMMAND}"
${PRE_COMMAND} ${COMMAND}