From 5c9d2062db2613b7724cb3f9b5a9903583bc171f Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Sat, 8 Jan 2022 22:33:08 +0000 Subject: [PATCH] Switch to using GitHub actions for container CI Signed-off-by: Jonathan Dieter --- .github/workflows/main.yml | 46 +++++++++++++++++++++++++++----- autotest/alpine-edge/build.sh | 2 +- autotest/alpine-edge/prep.sh | 2 +- autotest/alpine-edge/test.sh | 2 +- autotest/centos-7/build.sh | 2 +- autotest/centos-7/prep.sh | 2 +- autotest/centos-7/test.sh | 2 +- autotest/debian-latest/build.sh | 2 +- autotest/debian-latest/prep.sh | 2 +- autotest/debian-latest/test.sh | 2 +- autotest/fedora-latest/build.sh | 2 +- autotest/fedora-latest/prep.sh | 2 +- autotest/fedora-latest/test.sh | 2 +- autotest/opensuse-leap/build.sh | 2 +- autotest/opensuse-leap/prep.sh | 2 +- autotest/opensuse-leap/test.sh | 2 +- autotest/ubuntu-rolling/build.sh | 2 +- autotest/ubuntu-rolling/prep.sh | 2 +- autotest/ubuntu-rolling/test.sh | 2 +- 19 files changed, 57 insertions(+), 25 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58c749b..5cc98ec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,33 +14,63 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] + container_directory: [none, fedora-latest, centos-7, alpine-edge] + exclude: + - os: macos-latest + container_directory: fedora-latest + - os: macos-latest + container_directory: centos-7 + - os: macos-latest + container_directory: alpine-edge + - os: windows-latest + container_directory: fedora-latest + - os: windows-latest + container_directory: centos-7 + - os: windows-latest + container_directory: alpine-edge + - os: ubuntu-latest + container_directory: none name: Compile and Run Tests steps: - uses: actions/checkout@v2 + - uses: actions/checkout@v2 + if: runner.os == 'Windows' with: repository: wolfv/argp-standalone path: argp-standalone - name: install mamba uses: mamba-org/provision-with-micromamba@main + if: runner.os == 'Windows' || runner.os == 'macOS' with: environment-file: .github/environment.yml - - name: Compile zchunk + + - name: Compile zchunk in container + if: runner.os == 'Linux' + run: ./autotest/${{ matrix.container_directory }}/build.sh + + - name: Run zchunk tests in container + if: runner.os == 'Linux' + run: ./autotest/${{ matrix.container_directory }}/test.sh + + - name: Compile zchunk on macOS shell: bash -l {0} - if: runner.os != 'Windows' + if: runner.os == 'macOS' run: | meson builddir --prefix=$CONDA_PREFIX cd builddir ninja - - name: Run zchunk tests + + - name: Run zchunk tests on macOS shell: bash -l {0} - if: runner.os != 'Windows' + if: runner.os == 'macOS' run: | cd builddir ninja test - - name: Compile argp-standalone + + - name: Compile argp-standalone for Windows shell: cmd /C CALL {0} if: runner.os == 'Windows' run: | @@ -49,14 +79,16 @@ jobs: meson setup builddir meson compile -C builddir --prefix=%CONDA_PREFIX%\Library meson install -C builddir - - name: Compile zchunk + + - name: Compile zchunk on Windows shell: cmd /C CALL {0} if: runner.os == 'Windows' run: | CALL micromamba activate zchunk_test_env meson setup builddir meson compile -C builddir - - name: Run zchunk tests + + - name: Run zchunk tests on Windows shell: cmd /C CALL {0} if: runner.os == 'Windows' run: | diff --git a/autotest/alpine-edge/build.sh b/autotest/alpine-edge/build.sh index a406c6c..a65f3d3 100755 --- a/autotest/alpine-edge/build.sh +++ b/autotest/alpine-edge/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Build zchunk-alpine:edge if it doesn't exist HAVE_IMAGE=$(docker image ls -q zchunk-alpine:edge) if [ "$HAVE_IMAGE" == "" ]; then diff --git a/autotest/alpine-edge/prep.sh b/autotest/alpine-edge/prep.sh index 9a63b9a..840ebc4 100755 --- a/autotest/alpine-edge/prep.sh +++ b/autotest/alpine-edge/prep.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash docker pull alpine:edge if [ "$?" -ne 0 ]; then exit 1 diff --git a/autotest/alpine-edge/test.sh b/autotest/alpine-edge/test.sh index 4cdc2e1..b2d1747 100755 --- a/autotest/alpine-edge/test.sh +++ b/autotest/alpine-edge/test.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Build zchunk-alpine:edge if it doesn't exist HAVE_IMAGE=$(docker image ls -q zchunk-alpine:test) if [ "$HAVE_IMAGE" == "" ]; then diff --git a/autotest/centos-7/build.sh b/autotest/centos-7/build.sh index 3064cdd..d95262d 100755 --- a/autotest/centos-7/build.sh +++ b/autotest/centos-7/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Build zchunk-centos:7 if it doesn't exist HAVE_IMAGE=$(docker image ls -q zchunk-centos:7) if [ "$HAVE_IMAGE" == "" ]; then diff --git a/autotest/centos-7/prep.sh b/autotest/centos-7/prep.sh index a5e8098..547d978 100755 --- a/autotest/centos-7/prep.sh +++ b/autotest/centos-7/prep.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash docker pull centos:7 if [ "$?" -ne 0 ]; then exit 1 diff --git a/autotest/centos-7/test.sh b/autotest/centos-7/test.sh index 8034035..d9f8620 100755 --- a/autotest/centos-7/test.sh +++ b/autotest/centos-7/test.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Build zchunk-centos:7 if it doesn't exist HAVE_IMAGE=$(docker image ls -q zchunk-centos:test) if [ "$HAVE_IMAGE" == "" ]; then diff --git a/autotest/debian-latest/build.sh b/autotest/debian-latest/build.sh index c2c21b4..243ed1c 100755 --- a/autotest/debian-latest/build.sh +++ b/autotest/debian-latest/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Build zchunk-debian:latest if it doesn't exist HAVE_IMAGE=$(docker image ls -q zchunk-debian:latest) if [ "$HAVE_IMAGE" == "" ]; then diff --git a/autotest/debian-latest/prep.sh b/autotest/debian-latest/prep.sh index b0a0ec8..19d00df 100755 --- a/autotest/debian-latest/prep.sh +++ b/autotest/debian-latest/prep.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash docker pull debian:latest if [ "$?" -ne 0 ]; then exit 1 diff --git a/autotest/debian-latest/test.sh b/autotest/debian-latest/test.sh index 4bc1ab4..3f39e85 100755 --- a/autotest/debian-latest/test.sh +++ b/autotest/debian-latest/test.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Build zchunk-debian:latest if it doesn't exist HAVE_IMAGE=$(docker image ls -q zchunk-debian:test) if [ "$HAVE_IMAGE" == "" ]; then diff --git a/autotest/fedora-latest/build.sh b/autotest/fedora-latest/build.sh index d988967..a2cf8f8 100755 --- a/autotest/fedora-latest/build.sh +++ b/autotest/fedora-latest/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Build zchunk-fedora:latest if it doesn't exist HAVE_IMAGE=$(docker image ls -q zchunk-fedora:latest) if [ "$HAVE_IMAGE" == "" ]; then diff --git a/autotest/fedora-latest/prep.sh b/autotest/fedora-latest/prep.sh index 9095923..19536fb 100755 --- a/autotest/fedora-latest/prep.sh +++ b/autotest/fedora-latest/prep.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash docker pull fedora:latest if [ "$?" -ne 0 ]; then exit 1 diff --git a/autotest/fedora-latest/test.sh b/autotest/fedora-latest/test.sh index 3673dcf..3277cf5 100755 --- a/autotest/fedora-latest/test.sh +++ b/autotest/fedora-latest/test.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Build zchunk-fedora:latest if it doesn't exist HAVE_IMAGE=$(docker image ls -q zchunk-fedora:test) if [ "$HAVE_IMAGE" == "" ]; then diff --git a/autotest/opensuse-leap/build.sh b/autotest/opensuse-leap/build.sh index c1bf612..ecc1e18 100755 --- a/autotest/opensuse-leap/build.sh +++ b/autotest/opensuse-leap/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Build zchunk-opensuse:latest if it doesn't exist HAVE_IMAGE=$(docker image ls -q zchunk-opensuse:latest) if [ "$HAVE_IMAGE" == "" ]; then diff --git a/autotest/opensuse-leap/prep.sh b/autotest/opensuse-leap/prep.sh index f1a0c89..c2e2bbb 100755 --- a/autotest/opensuse-leap/prep.sh +++ b/autotest/opensuse-leap/prep.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash docker pull opensuse/leap if [ "$?" -ne 0 ]; then exit 1 diff --git a/autotest/opensuse-leap/test.sh b/autotest/opensuse-leap/test.sh index 93fdb4f..e4f52a3 100755 --- a/autotest/opensuse-leap/test.sh +++ b/autotest/opensuse-leap/test.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Build zchunk-opensuse:latest if it doesn't exist HAVE_IMAGE=$(docker image ls -q zchunk-opensuse:test) if [ "$HAVE_IMAGE" == "" ]; then diff --git a/autotest/ubuntu-rolling/build.sh b/autotest/ubuntu-rolling/build.sh index a484200..ab8c4ff 100755 --- a/autotest/ubuntu-rolling/build.sh +++ b/autotest/ubuntu-rolling/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Build zchunk-ubuntu:latest if it doesn't exist HAVE_IMAGE=$(docker image ls -q zchunk-ubuntu:latest) if [ "$HAVE_IMAGE" == "" ]; then diff --git a/autotest/ubuntu-rolling/prep.sh b/autotest/ubuntu-rolling/prep.sh index 79ae5bb..8dcbfd3 100755 --- a/autotest/ubuntu-rolling/prep.sh +++ b/autotest/ubuntu-rolling/prep.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash docker pull ubuntu:rolling if [ "$?" -ne 0 ]; then exit 1 diff --git a/autotest/ubuntu-rolling/test.sh b/autotest/ubuntu-rolling/test.sh index b2345b3..abc2ab0 100755 --- a/autotest/ubuntu-rolling/test.sh +++ b/autotest/ubuntu-rolling/test.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Build zchunk-ubuntu:latest if it doesn't exist HAVE_IMAGE=$(docker image ls -q zchunk-ubuntu:test) if [ "$HAVE_IMAGE" == "" ]; then -- 2.30.2