Skip to content

Commit 4f89255

Browse files
Formats CI yaml and switches to a recent install_docker script (#135)
The former script to install docker fails and also has dead links describing why it was written. This replaces the script with one updated this month, and with history and license info about where it came from. Signed-off-by: Adrian Cole <[email protected]>
1 parent a9457a0 commit 4f89255

File tree

7 files changed

+259
-220
lines changed

7 files changed

+259
-220
lines changed

.github/workflows/builders.yml

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,43 @@
1+
# yamllint --format github .github/workflows/builders.yml
2+
---
13
name: builders
24

35
on:
46
push:
5-
branches: [ master ]
7+
branches:
8+
- master
69
paths:
7-
- images/extension-builders/**
10+
- images/extension-builders/**
811
pull_request:
9-
branches: [ master ]
12+
branches:
13+
- master
1014
paths:
11-
- images/extension-builders/**
15+
- images/extension-builders/**
1216

1317
jobs:
1418
builders:
1519
runs-on: ubuntu-18.04
1620

1721
steps:
18-
- uses: actions/checkout@v2
19-
20-
- name: Build the Docker image
21-
run: make builders BUILDERS_TAG=${{ github.sha }}
22-
23-
- uses: azure/docker-login@v1
24-
with:
25-
username: ${{ secrets.DOCKERHUB_USERNAME }}
26-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
27-
if: github.event_name == 'push'
28-
29-
- name: Push the Docker image
30-
run: make builders.push BUILDERS_TAG=${{ github.sha }}
31-
if: github.event_name == 'push'
32-
33-
- name: Tag the Docker image as 'latest'
34-
run: make builders.tag BUILDERS_TAG=${{ github.sha }} EXTRA_TAG=latest
35-
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
36-
37-
- name: Push the 'latest' Docker image
38-
run: make builders.push BUILDERS_TAG=latest
39-
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
22+
- uses: actions/checkout@v2
23+
24+
- name: Build the Docker image
25+
run: make builders BUILDERS_TAG=${{ github.sha }}
26+
27+
- uses: azure/docker-login@v1
28+
with:
29+
username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
31+
if: github.event_name == 'push'
32+
33+
- name: Push the Docker image
34+
run: make builders.push BUILDERS_TAG=${{ github.sha }}
35+
if: github.event_name == 'push'
36+
37+
- name: Tag the Docker image as 'latest'
38+
run: make builders.tag BUILDERS_TAG=${{ github.sha }} EXTRA_TAG=latest
39+
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
40+
41+
- name: Push the 'latest' Docker image
42+
run: make builders.push BUILDERS_TAG=latest
43+
if: github.ref == 'refs/heads/master' && github.event_name == 'push'

.github/workflows/commit.yaml

Lines changed: 53 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,91 @@
11
# `name` value will appear "as is" in the badge.
22
# See https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#adding-a-workflow-status-badge-to-your-repository
3+
# yamllint --format github .github/workflows/commit.yaml
4+
---
35
name: "build"
46

57
on:
68
push:
79
branches:
8-
- master
10+
- master
911
pull_request:
1012
branches:
11-
- '**'
13+
- '**'
14+
# workflow_dispatch will let us manually trigger the workflow from GitHub actions dashboard.
15+
# This is important because sometimes the macos build fails due to Docker installation.
16+
# See https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/manually-running-a-workflow
17+
workflow_dispatch:
1218

1319
jobs:
1420
bin:
1521
name: "Build `getenvoy` and `e2e` binaries for use in e2e tests"
1622
runs-on: ubuntu-latest
1723
steps:
18-
- name: "Checkout"
19-
uses: actions/checkout@v2
24+
- name: "Checkout"
25+
uses: actions/checkout@v2
2026

21-
- name: "Install Go"
22-
uses: actions/setup-go@v2
23-
with:
24-
go-version: '1.16.2'
27+
- name: "Install Go"
28+
uses: actions/setup-go@v2
29+
with:
30+
go-version: '1.16.2'
2531

26-
- name: "Init on first use"
27-
run: make init
32+
- name: "Init on first use"
33+
run: make init
2834

29-
- name: "Build `getenvoy` and `e2e` binaries"
30-
run: make bin
35+
- name: "Build `getenvoy` and `e2e` binaries"
36+
run: make bin
3137

32-
- name: "Share `getenvoy` and `e2e` binaries with the downstream jobs"
33-
uses: actions/upload-artifact@v2
34-
with:
35-
name: bin
36-
path: build/bin
38+
- name: "Share `getenvoy` and `e2e` binaries with the downstream jobs"
39+
uses: actions/upload-artifact@v2
40+
with:
41+
name: bin
42+
path: build/bin
3743

3844
e2e_linux:
3945
name: "Run e2e tests on Linux"
4046
needs:
41-
- bin
47+
- bin
4248
runs-on: ubuntu-latest
4349
steps:
44-
- name: "Checkout"
45-
uses: actions/checkout@v2
50+
- name: "Checkout"
51+
uses: actions/checkout@v2
4652

47-
- name: "Re-use `getenvoy` and `e2e` binaries pre-built by the upstream job"
48-
uses: actions/download-artifact@v2
49-
with:
50-
name: bin
51-
path: build/bin
53+
- name: "Re-use `getenvoy` and `e2e` binaries pre-built by the upstream job"
54+
uses: actions/download-artifact@v2
55+
with:
56+
name: bin
57+
path: build/bin
5258

53-
- name: "Build language-specific Docker build images"
54-
run: make builders
59+
- name: "Build language-specific Docker build images"
60+
run: make builders
5561

56-
- name: "Run e2e tests using `getenvoy` and `e2e` binaries built by the upstream job"
57-
run: ./ci/e2e/linux/run_tests.sh
62+
- name: "Run e2e tests using `getenvoy` and `e2e` binaries built by the upstream job"
63+
run: ./ci/e2e/linux/run_tests.sh
5864

5965
e2e_macos:
6066
name: "Run e2e tests on MacOS"
6167
needs:
62-
- bin
68+
- bin
6369
runs-on: macos-latest
6470
steps:
65-
- name: "Checkout"
66-
uses: actions/checkout@v2
71+
- name: "Checkout"
72+
uses: actions/checkout@v2
6773

68-
- name: "Re-use `getenvoy` and `e2e` binaries pre-built by the upstream job"
69-
uses: actions/download-artifact@v2
70-
with:
71-
name: bin
72-
path: build/bin
74+
- name: "Re-use `getenvoy` and `e2e` binaries pre-built by the upstream job"
75+
uses: actions/download-artifact@v2
76+
with:
77+
name: bin
78+
path: build/bin
7379

74-
- name: "Install 'Docker for Mac' (an older version that can be installed in CI environment)"
75-
run: ./ci/e2e/macos/install_docker.sh
80+
- name: "Install 'Docker for Mac' (an older version that can be installed in CI environment)"
81+
run: ./ci/e2e/macos/install_docker.sh
7682

77-
- name: "Build language-specific Docker build images"
78-
env:
79-
# don't use `DOCKER_BUILDKIT=1`, `--build-arg BUILDKIT_INLINE_CACHE=1` and `--cache-from`
80-
# options when using `Docker for Mac` in CI environment
81-
USE_DOCKER_BUILDKIT_CACHE: 'no'
82-
run: make builders
83+
- name: "Build language-specific Docker build images"
84+
env:
85+
# don't use `DOCKER_BUILDKIT=1`, `--build-arg BUILDKIT_INLINE_CACHE=1` and `--cache-from`
86+
# options when using `Docker for Mac` in CI environment
87+
USE_DOCKER_BUILDKIT_CACHE: 'no'
88+
run: make builders
8389

84-
- name: "Run e2e tests using `getenvoy` and `e2e` binaries built by the upstream job"
85-
run: ./ci/e2e/macos/run_tests.sh
90+
- name: "Run e2e tests using `getenvoy` and `e2e` binaries built by the upstream job"
91+
run: ./ci/e2e/macos/run_tests.sh

0 commit comments

Comments
 (0)