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:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image:
|
||||||
|
git.kemitix.net/kemitix/rust:v3.0.0-rc2
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
toolchain:
|
toolchain:
|
||||||
- name: stable
|
- name: stable
|
||||||
- name: nightly
|
- name: nightly
|
||||||
- name: v1.74.1
|
- name: 1.74.1
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Machete
|
- name: Machete
|
||||||
uses: https://git.kemitix.net/kemitix/rust@v2.6.0-rc3
|
run: cargo machete
|
||||||
with:
|
|
||||||
args: cargo machete
|
|
||||||
|
|
||||||
- name: Format
|
- name: Format
|
||||||
uses: https://git.kemitix.net/kemitix/rust@v2.6.0-rc3
|
run: cargo +${{ matrix.toolchain.name }} fmt --check
|
||||||
with:
|
|
||||||
args: ${{ matrix.toolchain.name }} cargo fmt --check
|
|
||||||
|
|
||||||
- name: Clippy
|
- name: Clippy
|
||||||
uses: https://git.kemitix.net/kemitix/rust@v2.6.0-rc3
|
run: cargo +${{ matrix.toolchain.name }} clippy
|
||||||
with:
|
|
||||||
args: ${{ matrix.toolchain.name }} cargo clippy
|
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
uses: https://git.kemitix.net/kemitix/rust@v2.6.0-rc3
|
run: cargo +${{ matrix.toolchain.name }} test
|
||||||
with:
|
|
||||||
args: ${{ matrix.toolchain.name }} cargo test
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: https://git.kemitix.net/kemitix/rust@v2.6.0-rc3
|
run: cargo +${{ matrix.toolchain.name }} build
|
||||||
with:
|
|
||||||
args: ${{ matrix.toolchain.name }} cargo build
|
|
||||||
|
|
||||||
- name: Run
|
- name: Run
|
||||||
uses: https://git.kemitix.net/kemitix/rust@v2.6.0-rc3
|
run: cargo +${{ matrix.toolchain.name }} run
|
||||||
with:
|
|
||||||
args: ${{ matrix.toolchain.name }} cargo run
|
|
||||||
|
|
10
Dockerfile
10
Dockerfile
|
@ -27,18 +27,16 @@ RUN cargo binstall -y \
|
||||||
cargo-mutants@25.0 \
|
cargo-mutants@25.0 \
|
||||||
release-plz@0.3
|
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
|
# should be a no-op if the FROM line is up-to-date
|
||||||
RUN rustup update stable && rustup component add --toolchain stable rustfmt clippy
|
RUN rustup update stable && rustup component add --toolchain stable rustfmt clippy
|
||||||
|
|
||||||
# install nightly
|
# install nightly
|
||||||
RUN rustup install nightly && rustup component add --toolchain nightly rustfmt clippy
|
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" && \
|
RUN git config --global user.email "action@git.kemitix.net" && \
|
||||||
git config --global user.name "ForgeJo Action. See: https://git.kemitix.net/kemitix/rust"
|
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