Skip to content

Commit

Permalink
Split workflow for ubuntu-latest into separate job
Browse files Browse the repository at this point in the history
Run it first.  Don't bother with any of the flavors if it fails.

Also we don't need to run it in a "ubuntu-latest" container, because
we're already running in a "ubuntu-latest" VM.
  • Loading branch information
zpostfacto committed Jan 26, 2022
1 parent dc80d53 commit 003e559
Showing 1 changed file with 43 additions and 23 deletions.
66 changes: 43 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,41 @@ name: CI
on: [push, pull_request]

jobs:
test:
name: BuildAndTest

build-and-test-ubuntu:
name: Build And Test Ubuntu
runs-on: ubuntu-latest
env:
CI_BUILD: 1
IMAGE: ubuntu
IMAGE_TAG: latest
steps:
- uses: actions/checkout@master
# Note only alpine needs "preinstall" step
- name: Update packages
run: sudo -E bash .github/update-packages.sh
- name: Install dependencies
run: |
sudo -E bash .github/install.sh
sudo -E bash .github/install-post.sh
- name: Build and run tests
run: bash .github/build.sh

build-and-test-flavors:
name: Build And Test Unix Flavors
runs-on: ${{ matrix.os }}
needs: build-and-test-ubuntu # Don't both running flavors until after ubuntu has passed
strategy:
matrix:
build: [alpine-latest, ubuntu-bionic, ubuntu-latest, ubuntu-rolling, fedora-latest]
include:
- build: ubuntu-bionic
os: ubuntu-latest
docker_image: ubuntu
docker_tag: bionic
- build: ubuntu-latest
os: ubuntu-latest
docker_image: ubuntu
docker_tag: latest
#- build: ubuntu-latest
# os: ubuntu-latest
# docker_image: ubuntu
# docker_tag: latest
- build: ubuntu-rolling
os: ubuntu-latest
docker_image: ubuntu
Expand All @@ -38,19 +58,19 @@ jobs:
docker_image: alpine
docker_tag: latest
steps:
- uses: actions/checkout@master
- name: Launch container
run: |
docker run -d --rm --name github-docker-builder -e LC_ALL="C" -e LANG="C" -v ${{ github.workspace }}:/build -w /build ${{ matrix.docker_image }}:${{ matrix.docker_tag }} tail -f /dev/null
docker ps
docker exec -e CI_BUILD=1 -e IMAGE=${{ matrix.docker_image }} -e IMAGE_TAG=${{ matrix.docker_tag }} -t github-docker-builder sh .github/preinstall.sh
- name: Update packages
run: |
docker exec -e CI_BUILD=1 -e IMAGE=${{ matrix.docker_image }} -e IMAGE_TAG=${{ matrix.docker_tag }} -t github-docker-builder bash .github/update-packages.sh
- name: Install dependencies
run: |
docker exec -e CI_BUILD=1 -e IMAGE=${{ matrix.docker_image }} -e IMAGE_TAG=${{ matrix.docker_tag }} -t github-docker-builder bash .github/install.sh
docker exec -e CI_BUILD=1 -e IMAGE=${{ matrix.docker_image }} -e IMAGE_TAG=${{ matrix.docker_tag }} -t github-docker-builder bash .github/install-post.sh
- name: Build and run project
run: |
docker exec -e CI_BUILD=1 -e IMAGE=${{ matrix.docker_image }} -e IMAGE_TAG=${{ matrix.docker_tag }} -t github-docker-builder bash .github/build.sh
- uses: actions/checkout@master
- name: Launch container
run: |
docker run -d --rm --name github-docker-builder -e LC_ALL="C" -e LANG="C" -v ${{ github.workspace }}:/build -w /build ${{ matrix.docker_image }}:${{ matrix.docker_tag }} tail -f /dev/null
docker ps
docker exec -e CI_BUILD=1 -e IMAGE=${{ matrix.docker_image }} -e IMAGE_TAG=${{ matrix.docker_tag }} -t github-docker-builder sh .github/preinstall.sh
- name: Update packages
run: |
docker exec -e CI_BUILD=1 -e IMAGE=${{ matrix.docker_image }} -e IMAGE_TAG=${{ matrix.docker_tag }} -t github-docker-builder bash .github/update-packages.sh
- name: Install dependencies
run: |
docker exec -e CI_BUILD=1 -e IMAGE=${{ matrix.docker_image }} -e IMAGE_TAG=${{ matrix.docker_tag }} -t github-docker-builder bash .github/install.sh
docker exec -e CI_BUILD=1 -e IMAGE=${{ matrix.docker_image }} -e IMAGE_TAG=${{ matrix.docker_tag }} -t github-docker-builder bash .github/install-post.sh
- name: Build and run project
run: |
docker exec -e CI_BUILD=1 -e IMAGE=${{ matrix.docker_image }} -e IMAGE_TAG=${{ matrix.docker_tag }} -t github-docker-builder bash .github/build.sh

0 comments on commit 003e559

Please sign in to comment.