diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f45c08..c1ed48f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,36 +4,25 @@ on: push jobs: build: runs-on: ${{ matrix.os }} - name: ${{ matrix.name }} + container: ${{ matrix.container }} + name: ${{ matrix.container || matrix.os }}/${{ matrix.packaging }} strategy: fail-fast: false matrix: include: - - name: "Debian 11 (Bullseye)" - os: ubuntu-latest + - os: ubuntu-latest + container: debian:bullseye ci_type: deb - start_worker: "docker run -di -v ${WORKSPACE}:${WORKSPACE} --name worker --rm debian:bullseye" - worker: "docker exec -w ${WORKSPACE} -e WORKSPACE -e CMAKE_OPTIONS -e DEBIAN_FRONTEND=noninteractive worker" - stop_worker: "docker kill worker" - - name: "Debian 12 (Bookworm)" - os: ubuntu-latest + - os: ubuntu-latest + container: debian:bookworm ci_type: deb - start_worker: "docker run -di -v ${WORKSPACE}:${WORKSPACE} --name worker --rm debian:bookworm" - worker: "docker exec -w ${WORKSPACE} -e WORKSPACE -e CMAKE_OPTIONS -e DEBIAN_FRONTEND=noninteractive worker" - stop_worker: "docker kill worker" cmake_options: "-DCMAKE_CXX_STANDARD=17" - - name: "Ubuntu 20.04 (Focal)" - os: ubuntu-latest + - os: ubuntu-latest + container: ubuntu:focal ci_type: deb - start_worker: "docker run -di -v ${WORKSPACE}:${WORKSPACE} --name worker --rm ubuntu:focal" - worker: "docker exec -w ${WORKSPACE} -e WORKSPACE -e CMAKE_OPTIONS -e DEBIAN_FRONTEND=noninteractive worker" - stop_worker: "docker kill worker" - - name: "Ubuntu 22.04 (Jammy)" - os: ubuntu-latest + - os: ubuntu-latest + container: ubuntu:jammy ci_type: deb - start_worker: "docker run -di -v ${WORKSPACE}:${WORKSPACE} --name worker --rm ubuntu:jammy" - worker: "docker exec -w ${WORKSPACE} -e WORKSPACE -e CMAKE_OPTIONS -e DEBIAN_FRONTEND=noninteractive worker" - stop_worker: "docker kill worker" cmake_options: "-DCMAKE_CXX_STANDARD=17" # - name: "macOS 11 (Big Sur) + Homebrew" # os: macos-11 @@ -41,20 +30,15 @@ jobs: # start_worker: "" # worker: "" # stop_worker: "" + env: + WORKSPACE: "${{ github.workspace }}" + CMAKE_OPTIONS: "${{ matrix.cmake_options }}" steps: - - name: Configure environment - run: | - echo "WORKSPACE=${GITHUB_WORKSPACE}" >> $GITHUB_ENV - echo "CMAKE_OPTIONS=${{ matrix.cmake_options }}" >> $GITHUB_ENV - name: Checkout latest revision uses: actions/checkout@v4 - - name: Start the worker - run: ${{ matrix.start_worker }} - name: Configure the build - run: ${{ matrix.worker }} ./.ci/${{ matrix.ci_type}}/install + run: ./.ci/${{ matrix.ci_type}}/install - name: Build - run: ${{ matrix.worker }} ./.ci/${{ matrix.ci_type}}/build + run: ./.ci/${{ matrix.ci_type}}/build - name: Run tests - run: ${{ matrix.worker }} ./.ci/${{ matrix.ci_type}}/post_build - - name: Stop the worker - run: ${{ matrix.stop_worker }} + run: ./.ci/${{ matrix.ci_type}}/post_build