Skip to content

Commit 003e559

Browse files
committed
Split workflow for ubuntu-latest into separate job
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.
1 parent dc80d53 commit 003e559

File tree

1 file changed

+43
-23
lines changed

1 file changed

+43
-23
lines changed

.github/workflows/build.yml

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,41 @@ name: CI
22
on: [push, pull_request]
33

44
jobs:
5-
test:
6-
name: BuildAndTest
5+
6+
build-and-test-ubuntu:
7+
name: Build And Test Ubuntu
8+
runs-on: ubuntu-latest
9+
env:
10+
CI_BUILD: 1
11+
IMAGE: ubuntu
12+
IMAGE_TAG: latest
13+
steps:
14+
- uses: actions/checkout@master
15+
# Note only alpine needs "preinstall" step
16+
- name: Update packages
17+
run: sudo -E bash .github/update-packages.sh
18+
- name: Install dependencies
19+
run: |
20+
sudo -E bash .github/install.sh
21+
sudo -E bash .github/install-post.sh
22+
- name: Build and run tests
23+
run: bash .github/build.sh
24+
25+
build-and-test-flavors:
26+
name: Build And Test Unix Flavors
727
runs-on: ${{ matrix.os }}
28+
needs: build-and-test-ubuntu # Don't both running flavors until after ubuntu has passed
829
strategy:
930
matrix:
10-
build: [alpine-latest, ubuntu-bionic, ubuntu-latest, ubuntu-rolling, fedora-latest]
1131
include:
1232
- build: ubuntu-bionic
1333
os: ubuntu-latest
1434
docker_image: ubuntu
1535
docker_tag: bionic
16-
- build: ubuntu-latest
17-
os: ubuntu-latest
18-
docker_image: ubuntu
19-
docker_tag: latest
36+
#- build: ubuntu-latest
37+
# os: ubuntu-latest
38+
# docker_image: ubuntu
39+
# docker_tag: latest
2040
- build: ubuntu-rolling
2141
os: ubuntu-latest
2242
docker_image: ubuntu
@@ -38,19 +58,19 @@ jobs:
3858
docker_image: alpine
3959
docker_tag: latest
4060
steps:
41-
- uses: actions/checkout@master
42-
- name: Launch container
43-
run: |
44-
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
45-
docker ps
46-
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
47-
- name: Update packages
48-
run: |
49-
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
50-
- name: Install dependencies
51-
run: |
52-
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
53-
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
54-
- name: Build and run project
55-
run: |
56-
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
61+
- uses: actions/checkout@master
62+
- name: Launch container
63+
run: |
64+
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
65+
docker ps
66+
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
67+
- name: Update packages
68+
run: |
69+
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
70+
- name: Install dependencies
71+
run: |
72+
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
73+
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
74+
- name: Build and run project
75+
run: |
76+
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 commit comments

Comments
 (0)