feat: drop entrypoint in favour of using 'run' over 'uses'
This commit is contained in:
parent
cb915104cb
commit
da790827d4
3 changed files with 14 additions and 70 deletions
|
@ -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
|
||||
|
|
10
Dockerfile
10
Dockerfile
|
@ -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
|
||||
|
|
|
@ -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}
|
Loading…
Add table
Reference in a new issue