Skip to content

Commit

Permalink
Formats CI yaml and switches to a recent install_docker script (#135)
Browse files Browse the repository at this point in the history
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 <adrian@tetrate.io>
  • Loading branch information
codefromthecrypt authored Mar 26, 2021
1 parent a9457a0 commit 4f89255
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 220 deletions.
56 changes: 30 additions & 26 deletions .github/workflows/builders.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,43 @@
# yamllint --format github .github/workflows/builders.yml
---
name: builders

on:
push:
branches: [ master ]
branches:
- master
paths:
- images/extension-builders/**
- images/extension-builders/**
pull_request:
branches: [ master ]
branches:
- master
paths:
- images/extension-builders/**
- images/extension-builders/**

jobs:
builders:
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: make builders BUILDERS_TAG=${{ github.sha }}

- uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
if: github.event_name == 'push'
- name: Push the Docker image
run: make builders.push BUILDERS_TAG=${{ github.sha }}
if: github.event_name == 'push'

- name: Tag the Docker image as 'latest'
run: make builders.tag BUILDERS_TAG=${{ github.sha }} EXTRA_TAG=latest
if: github.ref == 'refs/heads/master' && github.event_name == 'push'

- name: Push the 'latest' Docker image
run: make builders.push BUILDERS_TAG=latest
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
- uses: actions/checkout@v2

- name: Build the Docker image
run: make builders BUILDERS_TAG=${{ github.sha }}

- uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
if: github.event_name == 'push'

- name: Push the Docker image
run: make builders.push BUILDERS_TAG=${{ github.sha }}
if: github.event_name == 'push'

- name: Tag the Docker image as 'latest'
run: make builders.tag BUILDERS_TAG=${{ github.sha }} EXTRA_TAG=latest
if: github.ref == 'refs/heads/master' && github.event_name == 'push'

- name: Push the 'latest' Docker image
run: make builders.push BUILDERS_TAG=latest
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
100 changes: 53 additions & 47 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
@@ -1,85 +1,91 @@
# `name` value will appear "as is" in the badge.
# See https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#adding-a-workflow-status-badge-to-your-repository
# yamllint --format github .github/workflows/commit.yaml
---
name: "build"

on:
push:
branches:
- master
- master
pull_request:
branches:
- '**'
- '**'
# workflow_dispatch will let us manually trigger the workflow from GitHub actions dashboard.
# This is important because sometimes the macos build fails due to Docker installation.
# See https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/manually-running-a-workflow
workflow_dispatch:

jobs:
bin:
name: "Build `getenvoy` and `e2e` binaries for use in e2e tests"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Checkout"
uses: actions/checkout@v2

- name: "Install Go"
uses: actions/setup-go@v2
with:
go-version: '1.16.2'
- name: "Install Go"
uses: actions/setup-go@v2
with:
go-version: '1.16.2'

- name: "Init on first use"
run: make init
- name: "Init on first use"
run: make init

- name: "Build `getenvoy` and `e2e` binaries"
run: make bin
- name: "Build `getenvoy` and `e2e` binaries"
run: make bin

- name: "Share `getenvoy` and `e2e` binaries with the downstream jobs"
uses: actions/upload-artifact@v2
with:
name: bin
path: build/bin
- name: "Share `getenvoy` and `e2e` binaries with the downstream jobs"
uses: actions/upload-artifact@v2
with:
name: bin
path: build/bin

e2e_linux:
name: "Run e2e tests on Linux"
needs:
- bin
- bin
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Checkout"
uses: actions/checkout@v2

- name: "Re-use `getenvoy` and `e2e` binaries pre-built by the upstream job"
uses: actions/download-artifact@v2
with:
name: bin
path: build/bin
- name: "Re-use `getenvoy` and `e2e` binaries pre-built by the upstream job"
uses: actions/download-artifact@v2
with:
name: bin
path: build/bin

- name: "Build language-specific Docker build images"
run: make builders
- name: "Build language-specific Docker build images"
run: make builders

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

e2e_macos:
name: "Run e2e tests on MacOS"
needs:
- bin
- bin
runs-on: macos-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Checkout"
uses: actions/checkout@v2

- name: "Re-use `getenvoy` and `e2e` binaries pre-built by the upstream job"
uses: actions/download-artifact@v2
with:
name: bin
path: build/bin
- name: "Re-use `getenvoy` and `e2e` binaries pre-built by the upstream job"
uses: actions/download-artifact@v2
with:
name: bin
path: build/bin

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

- name: "Build language-specific Docker build images"
env:
# don't use `DOCKER_BUILDKIT=1`, `--build-arg BUILDKIT_INLINE_CACHE=1` and `--cache-from`
# options when using `Docker for Mac` in CI environment
USE_DOCKER_BUILDKIT_CACHE: 'no'
run: make builders
- name: "Build language-specific Docker build images"
env:
# don't use `DOCKER_BUILDKIT=1`, `--build-arg BUILDKIT_INLINE_CACHE=1` and `--cache-from`
# options when using `Docker for Mac` in CI environment
USE_DOCKER_BUILDKIT_CACHE: 'no'
run: make builders

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

0 comments on commit 4f89255

Please sign in to comment.