From f92c3c2f4649f5a679ec8e97378e09914e44a1f0 Mon Sep 17 00:00:00 2001 From: lens0021 Date: Tue, 17 Dec 2024 23:23:59 +0900 Subject: [PATCH] run workflow --- .github/workflows/rust.yml | 45 ++++++++++++++++++++------------------ TestEnvDockerfile | 18 +++++++-------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 73905948..28920e6f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,26 +2,26 @@ name: Cargo & Clippy Test on: push: - branches: [master] - paths: - - src/** - - test_files/** - - .cargo/** - - Cargo.toml - - Cargo.lock - - rust-toolchain.toml - - flake.nix - - flake.lock - pull_request: - paths: - - src/** - - test_files/** - - .cargo/** - - Cargo.toml - - Cargo.lock - - rust-toolchain.toml - - flake.nix - - flake.lock + # branches: [master] + # paths: + # - src/** + # - test_files/** + # - .cargo/** + # - Cargo.toml + # - Cargo.lock + # - rust-toolchain.toml + # - flake.nix + # - flake.lock + # pull_request: + # paths: + # - src/** + # - test_files/** + # - .cargo/** + # - Cargo.toml + # - Cargo.lock + # - rust-toolchain.toml + # - flake.nix + # - flake.lock env: CARGO_TERM_COLOR: always @@ -111,7 +111,10 @@ jobs: if [ -f "~/docker-images/${{ matrix.bash_docker_image }}-${{ matrix.sed }}" ]; then docker load -i "~/docker-images/${{ matrix.bash_docker_image }}-${{ matrix.sed }}" else - docker build --tag testbash + docker build --tag testbash -f TestEnvDockerfile \ + --build-arg "BASE_BASH_IMAGE=${{ matrix.bash_docker_image }}" \ + --build-arg "INSTALL_GNU_SED=${{ matrix.sed }}" \ + . docker save -o "~/docker-images/${{ matrix.bash_docker_image }}-${{ matrix.sed }}" fi - name: Run cargo tests diff --git a/TestEnvDockerfile b/TestEnvDockerfile index 8b3841ad..4aa2788f 100644 --- a/TestEnvDockerfile +++ b/TestEnvDockerfile @@ -1,22 +1,20 @@ -LABEL description="Used to test the compiled bash script for various environment." - ARG BASE_BASE_IMAGE=bash:5.2 ARG INSTALL_GNU_SED FROM $BASE_BASE_IMAGE -# A non-root user(guest) is required by is_root() test -RUN useradd -m appuser -USER appuser -WORKDIR /home/appuser - RUN apk add \ curl \ # Includes mktemp coreutils \ ; - -RUN if [ -n "$INSTALL_GNU_SED" ]; then \ - apk add sed \ +RUN if [ "$INSTALL_GNU_SED" == "GNU sed" ]; \ + then apk add sed; \ fi +# A non-root user(guest) is required by is_root() test +RUN adduser -D appuser +USER appuser +WORKDIR /home/appuser + CMD ["sleep", "infinity"] +LABEL description="Used to test the compiled bash script for various environment."