diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bfb5dec3..3843c9bc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,16 @@ jobs: distro: ubuntu18.04 - arch: aarch64 distro: bullseye + - arch: i386 + distro: bullseye + - arch: amd64 + distro: bullseye + - arch: mips64le + distro: bullseye + - arch: i386 + distro: alpine_latest + - arch: riscv64 + distro: unstable # Run tests that only need to be run on one matrix node run_extra_tests: true @@ -80,7 +90,7 @@ jobs: # image layer. install: | case "${{ matrix.distro }}" in - ubuntu*|jessie|stretch|buster|bullseye) + ubuntu*|jessie|stretch|buster|bullseye|unstable|experimental) apt-get update -q -y apt-get install -q -y git ;; @@ -169,6 +179,9 @@ jobs: case "${{ matrix.arch }}" in armv6) expected_arch="armv6l" ;; armv7) expected_arch="armv7l" ;; + mips64le) expected_arch="mips64" ;; + i386) expected_arch="i686" ;; + amd64) expected_arch="x86_64" ;; *) expected_arch="${{ matrix.arch }}" ;; esac @@ -184,6 +197,7 @@ jobs: ubuntu*) distro_key="ubuntu" ;; fedora*) distro_key="fedora" ;; archarm*) distro_key="archarm" ;; + unstable) distro_key="pretty_name=debian gnu/linux bookworm/sid;name=debian gnu/linux;id=debian;home_url=https://www.debian.org/;support_url=https://www.debian.org/support;bug_report_url=https://bugs.debian.org/;" ;; *) distro_key="${{ matrix.distro }}" ;; esac diff --git a/Dockerfiles/Dockerfile.amd64.bullseye b/Dockerfiles/Dockerfile.amd64.bullseye new file mode 100644 index 00000000..18e1fa7e --- /dev/null +++ b/Dockerfiles/Dockerfile.amd64.bullseye @@ -0,0 +1,4 @@ +FROM amd64/debian:bullseye + +COPY ./run-on-arch-install.sh /root/run-on-arch-install.sh +RUN chmod +x /root/run-on-arch-install.sh && /root/run-on-arch-install.sh \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.amd64.buster b/Dockerfiles/Dockerfile.amd64.buster new file mode 100644 index 00000000..4dfa96da --- /dev/null +++ b/Dockerfiles/Dockerfile.amd64.buster @@ -0,0 +1,4 @@ +FROM amd64/debian:buster + +COPY ./run-on-arch-install.sh /root/run-on-arch-install.sh +RUN chmod +x /root/run-on-arch-install.sh && /root/run-on-arch-install.sh diff --git a/Dockerfiles/Dockerfile.i386.alpine_latest b/Dockerfiles/Dockerfile.i386.alpine_latest new file mode 100644 index 00000000..3b01e690 --- /dev/null +++ b/Dockerfiles/Dockerfile.i386.alpine_latest @@ -0,0 +1,5 @@ +FROM i386/alpine:latest + +COPY ./run-on-arch-install.sh /root/run-on-arch-install.sh +RUN chmod +x /root/run-on-arch-install.sh && /root/run-on-arch-install.sh +ENTRYPOINT ["linux32", "--"] diff --git a/Dockerfiles/Dockerfile.i386.bullseye b/Dockerfiles/Dockerfile.i386.bullseye new file mode 100644 index 00000000..017ac322 --- /dev/null +++ b/Dockerfiles/Dockerfile.i386.bullseye @@ -0,0 +1,5 @@ +FROM i386/debian:bullseye + +COPY ./run-on-arch-install.sh /root/run-on-arch-install.sh +RUN chmod +x /root/run-on-arch-install.sh && /root/run-on-arch-install.sh +ENTRYPOINT ["linux32", "--"] diff --git a/Dockerfiles/Dockerfile.i386.buster b/Dockerfiles/Dockerfile.i386.buster new file mode 100644 index 00000000..d204520d --- /dev/null +++ b/Dockerfiles/Dockerfile.i386.buster @@ -0,0 +1,5 @@ +FROM i386/debian:buster + +COPY ./run-on-arch-install.sh /root/run-on-arch-install.sh +RUN chmod +x /root/run-on-arch-install.sh && /root/run-on-arch-install.sh +ENTRYPOINT ["linux32", "--"] diff --git a/Dockerfiles/Dockerfile.mips64le.bullseye b/Dockerfiles/Dockerfile.mips64le.bullseye new file mode 100644 index 00000000..f8ab9115 --- /dev/null +++ b/Dockerfiles/Dockerfile.mips64le.bullseye @@ -0,0 +1,4 @@ +FROM mips64le/debian:bullseye + +COPY ./run-on-arch-install.sh /root/run-on-arch-install.sh +RUN chmod +x /root/run-on-arch-install.sh && /root/run-on-arch-install.sh diff --git a/Dockerfiles/Dockerfile.mips64le.buster b/Dockerfiles/Dockerfile.mips64le.buster new file mode 100644 index 00000000..0558efcd --- /dev/null +++ b/Dockerfiles/Dockerfile.mips64le.buster @@ -0,0 +1,4 @@ +FROM mips64le/debian:buster + +COPY ./run-on-arch-install.sh /root/run-on-arch-install.sh +RUN chmod +x /root/run-on-arch-install.sh && /root/run-on-arch-install.sh diff --git a/Dockerfiles/Dockerfile.riscv64.experimental b/Dockerfiles/Dockerfile.riscv64.experimental new file mode 100644 index 00000000..cd182f16 --- /dev/null +++ b/Dockerfiles/Dockerfile.riscv64.experimental @@ -0,0 +1,4 @@ +FROM riscv64/debian:experimental + +COPY ./run-on-arch-install.sh /root/run-on-arch-install.sh +RUN chmod +x /root/run-on-arch-install.sh && /root/run-on-arch-install.sh diff --git a/Dockerfiles/Dockerfile.riscv64.unstable b/Dockerfiles/Dockerfile.riscv64.unstable new file mode 100644 index 00000000..0462bf4c --- /dev/null +++ b/Dockerfiles/Dockerfile.riscv64.unstable @@ -0,0 +1,4 @@ +FROM riscv64/debian:unstable + +COPY ./run-on-arch-install.sh /root/run-on-arch-install.sh +RUN chmod +x /root/run-on-arch-install.sh && /root/run-on-arch-install.sh diff --git a/README.md b/README.md index abd5e970..18d6cdc9 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A GitHub Action that executes commands on non-x86 CPU architecture (armv6, armv7 This action requires three input parameters: -* `arch`: CPU architecture: `armv6`, `armv7`, `aarch64`, `s390x`, or `ppc64le`. See [Supported Platforms](#supported-platforms) for the full matrix. +* `arch`: CPU architecture: `armv6`, `armv7`, `aarch64`, `s390x`, `ppc64le`, `i386`, `amd64`, `mips64le`, or `riscv64`. See [Supported Platforms](#supported-platforms) for the full matrix. * `distro`: Linux distribution name: `ubuntu16.04`, `ubuntu18.04`, `ubuntu20.04`, `bullseye`, `buster`, `stretch`, `jessie`, `fedora_latest`, `alpine_latest` or `archarm_latest`. See [Supported Platforms](#supported-platforms) for the full matrix. * `run`: Shell commands to execute in the container. @@ -154,6 +154,10 @@ This table details the valid `arch`/`distro` combinations: | aarch64 | stretch, buster, bullseye, ubuntu16.04, ubuntu18.04, ubuntu20.04, fedora_latest, alpine_latest, archarm_latest | | s390x | jessie, stretch, buster, bullseye, ubuntu16.04, ubuntu18.04, ubuntu20.04, fedora_latest, alpine_latest | | ppc64le | jessie, stretch, buster, bullseye, ubuntu16.04, ubuntu18.04,ubuntu20.04, fedora_latest, alpine_latest | +| amd64 | buster, bullseye | +| i386 | buster, bullseye, alpine_lastest | +| mips64le | buster, bullseye | +| riscv64 | unstable, experimental | Using an invalid `arch`/`distro` combination will fail. @@ -162,6 +166,8 @@ Using an invalid `arch`/`distro` combination will fail. New distros and archs can be added simply by creating a Dockerfile named `Dockerfile.{arch}.{distro}` (that targets an image for the desired combination) in the [Dockerfiles](https://github.com/uraimo/run-on-arch-action/blob/master/Dockerfiles) directory. Pull requests welcome! +Note: If you're adding an i386 architecture distro, make sure that the Dockerfile contains `ENTRYPOINT ["linux32", "--"]`, otherwise uname will report incorrect architecture. + ## Authors [Umberto Raimondi](https://github.com/uraimo) diff --git a/src/run-on-arch.sh b/src/run-on-arch.sh index f2b385f3..96e65265 100755 --- a/src/run-on-arch.sh +++ b/src/run-on-arch.sh @@ -98,6 +98,7 @@ run_container () { docker run \ --workdir "${GITHUB_WORKSPACE}" \ --rm \ + --privileged=true \ -e DEBIAN_FRONTEND=noninteractive \ -e CI \ -e GITHUB_ACTION \