diff options
author | Oneric <oneric@oneric.stub> | 2021-06-20 01:06:47 +0200 |
---|---|---|
committer | Oneric <oneric@oneric.stub> | 2021-07-03 22:51:50 +0200 |
commit | 856824f94a95e30b477f4ff7f3badcafd41285f1 (patch) | |
tree | db4283d70fd9627984f6d40453b645e7e02039e2 | |
parent | 4779444abaac9313a8c42d3d4e21f4e280883095 (diff) | |
download | libass-856824f94a95e30b477f4ff7f3badcafd41285f1.tar.bz2 libass-856824f94a95e30b477f4ff7f3badcafd41285f1.tar.xz |
ci/gha: add musl build
Since GHA only has native support for glibc-linux use Alpine via Docker.
Even though GHA does have native Docker support, its
`job.<name>.container` option cannot be used here, as there appears to
be no way to set a noop image name atm (empty string causes an error).
Using `tail -f /dev/null` to keep the image running (while ignoring
zombie processes) was taken from GHA's native Docker setup procedure.
Relies on /home/runner/work being the default for checked out repos.
-rw-r--r-- | .github/workflows/ghci.yml | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/.github/workflows/ghci.yml b/.github/workflows/ghci.yml index eab244e..bc13b59 100644 --- a/.github/workflows/ghci.yml +++ b/.github/workflows/ghci.yml @@ -8,6 +8,7 @@ on: jobs: build: runs-on: ${{ matrix.os }} + name: build(${{ matrix.docker_image || matrix.os }}, ${{ matrix.cc }}) strategy: matrix: os: [ubuntu-18.04, macos-10.15] @@ -24,6 +25,11 @@ jobs: - os: ubuntu-18.04 cc: clang do_coverity: yes + # Build in an Alpine Docker image + - os: ubuntu-latest + cc: gcc + docker_image: alpine:latest + shell: '/usr/bin/docker exec dockerciimage sh -e {0}' # Add an additional Windows build (MinGW-gcc via MSYS2) with no extras - os: windows-2019 cc: gcc @@ -37,6 +43,17 @@ jobs: - name: checkout code uses: actions/checkout@v2 + - name: Start Docker + if: matrix.docker_image + shell: bash + run: | + # Note: With this setup everything inside the container will be run as root + docker pull "${{ matrix.docker_image }}" + docker create --name dockerciimage \ + -v "/home/runner/work:/home/runner/work" --workdir "$PWD" \ + --entrypoint "tail" "${{ matrix.docker_image }}" "-f" "/dev/null" + docker start dockerciimage + - name: Setup MSys2 uses: msys2/setup-msys2@v2 if: matrix.os == 'windows-2019' @@ -46,7 +63,7 @@ jobs: - name: install deps run: | - case "${{ matrix.os }}" in + case "${{ matrix.docker_image || matrix.os }}" in macos-*) #brew update # fontconfig, freetype, autoconf and libtool are preinstalled @@ -61,6 +78,11 @@ jobs: $pre-libtool $pre-pkg-config $pre-gcc \ $pre-fribidi $pre-freetype $pre-harfbuzz $pre-fontconfig ;; + alpine:*) + apk add nasm ${{ matrix.cc }} musl-dev \ + make automake autoconf libtool pkgconf \ + fontconfig-dev freetype-dev fribidi-dev harfbuzz-dev + ;; *) sudo apt-get update #&& sudo apt-get upgrade sudo apt-get install -y \ @@ -161,3 +183,10 @@ jobs: exit $exit_code fi + + + - name: Stop Docker + if: matrix.docker_image + shell: bash + run: | + docker rm --force dockerciimage |