Skip to content

Commit

Permalink
run workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lens0021 committed Dec 17, 2024
1 parent 042c595 commit f92c3c2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 31 deletions.
45 changes: 24 additions & 21 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
18 changes: 8 additions & 10 deletions TestEnvDockerfile
Original file line number Diff line number Diff line change
@@ -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."

0 comments on commit f92c3c2

Please sign in to comment.