Skip to content

Commit

Permalink
test: enable qemu strace when workflow is in debug mode
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Jan 28, 2025
1 parent d84e074 commit f28994b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ jobs:
logs_ctn_name: postgis
logs_check: "UTC [1] LOG: database system is ready to accept connections"
steps:
- name: Prepare
run: |
qemustrace=0
if [ "$RUNNER_DEBUG" = "1" ]; then
qemustrace=1
fi
echo "QEMU_STRACE=$qemustrace" >> $GITHUB_ENV
-
name: Checkout
uses: actions/checkout@v4
Expand All @@ -186,19 +193,19 @@ jobs:
name: Test
working-directory: test/dockerfiles/${{ matrix.dockerfile }}
run: |
docker buildx build --platform ${{ matrix.platform }} --output type=cacheonly .
docker buildx build --build-arg QEMU_STRACE=$QEMU_STRACE --platform ${{ matrix.platform }} --output type=cacheonly .
-
name: Load image
if: ${{ matrix.run_args != '' }}
working-directory: test/dockerfiles/${{ matrix.dockerfile }}
run: |
docker buildx build --platform ${{ matrix.platform }} -t ${{ matrix.dockerfile }}:local --load .
docker buildx build --build-arg QEMU_STRACE=$QEMU_STRACE --platform ${{ matrix.platform }} -t ${{ matrix.dockerfile }}:local --load .
-
name: Run
if: ${{ matrix.run_args != '' }}
working-directory: test/dockerfiles/${{ matrix.dockerfile }}
run: |
docker run ${{ matrix.run_args }} --platform ${{ matrix.platform }} ${{ matrix.dockerfile }}:local
docker run ${{ matrix.run_args }} --env QEMU_STRACE --platform ${{ matrix.platform }} ${{ matrix.dockerfile }}:local
-
name: Check container logs
if: ${{ matrix.logs_ctn_name != '' && matrix.logs_check != '' }}
Expand Down
3 changes: 3 additions & 0 deletions test/dockerfiles/ejabberd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ RUN apk upgrade --update musl \
yaml-dev \
zlib-dev

ARG QEMU_STRACE=0
ENV QEMU_STRACE=$QEMU_STRACE

RUN mix local.hex --force \
&& mix local.rebar --force

Expand Down
15 changes: 5 additions & 10 deletions test/dockerfiles/pip-youtube-dl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
#
# Dockerfile for youtube-dl
#

FROM python:3.9-alpine
MAINTAINER kev <[email protected]>

RUN set -xe \
&& apk add --no-cache ca-certificates \
ffmpeg \
openssl \
aria2 \
&& pip3 install youtube-dl
RUN apk add --no-cache ca-certificates ffmpeg openssl aria2

ARG QEMU_STRACE=0
ENV QEMU_STRACE=$QEMU_STRACE
RUN pip3 install youtube-dl

# Try to run it so we know it works
RUN youtube-dl --version
Expand Down
2 changes: 2 additions & 0 deletions test/dockerfiles/postgis/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
FROM postgis/postgis:15-master
ARG QEMU_STRACE=0
ENV QEMU_STRACE=$QEMU_STRACE
ENV POSTGRES_PASSWORD=password
3 changes: 3 additions & 0 deletions test/dockerfiles/tini/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ RUN <<EOT
chmod +x /tini
file /tini
EOT

ARG QEMU_STRACE=0
ENV QEMU_STRACE=$QEMU_STRACE
CMD [ "/tini", "-s", "--", "uname", "-a" ]
2 changes: 2 additions & 0 deletions test/dockerfiles/webpack/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ RUN npm install .

COPY . /js

ARG QEMU_STRACE=0
ENV QEMU_STRACE=$QEMU_STRACE
RUN webpack\
--verbose\
--display=verbose\
Expand Down

0 comments on commit f28994b

Please sign in to comment.