initial #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
pull_request_target: | |
push: | |
branches: | |
- main | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: ["amd64", "arm64/v8", "arm/v7"] | |
busybox: ["glibc", "musl", "uclibc"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: arm64,arm | |
- name: Setup buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build container | |
uses: docker/build-push-action@v6 | |
with: | |
build-args: ARCH=${{ matrix.arch }} | |
context: . | |
file: ./Dockerfile | |
load: true | |
push: false | |
tags: test-${{ matrix.arch }}-${{ matrix.busybox }} | |
- name: Test | |
run: | | |
test "$(docker run --rm -i "test-${{ matrix.arch }}-${{ matrix.busybox }}" -c "php -r 'echo shell_exec(\"whoami\");'")" = "nonroot" |