diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 136b5c6ab..a701e4692 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,13 @@ permissions: contents: read jobs: + alpine: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, build_tools/update-dependencies.sh + - run: + docker/docker_run_tests.sh docker/alpine.Dockerfile + ubuntu: runs-on: ubuntu-latest steps: diff --git a/docker/alpine.Dockerfile b/docker/alpine.Dockerfile new file mode 100644 index 000000000..0777d5fe8 --- /dev/null +++ b/docker/alpine.Dockerfile @@ -0,0 +1,45 @@ +# Version set by updatecli.d/docker.yml +FROM alpine:3.23 +LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +RUN apk add --no-cache \ + bash \ + cargo \ + g++ \ + gettext-dev \ + git \ + libintl \ + musl-dev \ + pcre2-dev \ + py3-pexpect \ + py3-pip \ + python3 \ + rust \ + sudo \ + tmux + +RUN addgroup -g 1000 fishuser + +RUN adduser \ + --disabled-password \ + --gecos "" \ + --home "/home/fishuser" \ + --ingroup fishuser \ + --uid 1000 \ + fishuser + +RUN mkdir -p /home/fishuser/fish-build \ + && mkdir /fish-source \ + && chown -R fishuser:fishuser /home/fishuser /fish-source + +USER fishuser +WORKDIR /home/fishuser + +COPY fish_run_tests.sh / + +ENV FISH_CHECK_LINT=false + +CMD /fish_run_tests.sh diff --git a/docker/docker_run_tests.sh b/docker/docker_run_tests.sh index 5ed7f0d26..a238538da 100755 --- a/docker/docker_run_tests.sh +++ b/docker/docker_run_tests.sh @@ -54,8 +54,9 @@ docker build \ "$workspace_root"/docker/context/ # Run tests in it, allowing them to fail without failing this script. +# shellcheck disable=SC2046 # for the isatty snippet # shellcheck disable=SC2086 # $DOCKER_EXTRA_ARGS should have globbing and splitting applied. -docker run -it \ +docker run -i $(isatty 0 && printf %s -t) \ --mount type=bind,source="$workspace_root",target=/fish-source,readonly \ $DOCKER_EXTRA_ARGS \ "$IMG_TAGNAME" diff --git a/updatecli.d/docker.yml b/updatecli.d/docker.yml index a87127a33..0d4b3b0a3 100644 --- a/updatecli.d/docker.yml +++ b/updatecli.d/docker.yml @@ -1,6 +1,13 @@ name: "Update Linux docker images" sources: + alpine_latest_version: + kind: dockerimage + spec: + image: alpine + tagfilter: "^[0-9]+\\.[0-9]+$" + versionfilter: + kind: semver ubuntu_latest_lts_version: kind: shell spec: @@ -17,6 +24,14 @@ sources: tail -1 targets: + update_alpine_dockerfile: + name: "Update Alpine Linux version" + sourceid: alpine_latest_version + kind: file + spec: + file: docker/alpine.Dockerfile + matchpattern: "FROM alpine:.*" + replacepattern: 'FROM alpine:{{ source "alpine_latest_version" }}' ubuntu_latest_version_dockerfile: name: "Update oldest non-EOL Ubuntu Linux version" sourceid: ubuntu_latest_lts_version