2020-04-30 17:37:41 +02:00
|
|
|
name: Continuous integration
|
|
|
|
|
2020-09-28 12:29:59 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
2020-05-14 13:35:55 +02:00
|
|
|
|
2020-04-30 17:37:41 +02:00
|
|
|
jobs:
|
2020-05-14 13:35:55 +02:00
|
|
|
lint:
|
|
|
|
name: Lint
|
|
|
|
runs-on: ubuntu-latest
|
2020-05-14 22:13:35 +02:00
|
|
|
env:
|
|
|
|
GO111MODULE: "on"
|
2020-05-14 13:35:55 +02:00
|
|
|
steps:
|
2020-08-12 10:36:09 +02:00
|
|
|
- name: Set up Go 1.15
|
2020-05-14 22:13:35 +02:00
|
|
|
uses: actions/setup-go@v1
|
|
|
|
with:
|
2020-08-12 10:36:09 +02:00
|
|
|
go-version: 1.15
|
2020-05-14 22:13:35 +02:00
|
|
|
id: go
|
|
|
|
|
2020-05-14 13:35:55 +02:00
|
|
|
- name: Checkout code into the Go module directory
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2020-08-18 11:53:17 +02:00
|
|
|
- name: Validate go-mod is up-to-date and license headers
|
2020-08-17 15:18:47 +02:00
|
|
|
run: make validate
|
|
|
|
|
2020-08-18 16:10:34 +02:00
|
|
|
- name: Validate imports
|
|
|
|
run: make import-restrictions
|
|
|
|
|
2020-05-14 13:35:55 +02:00
|
|
|
- name: Run golangci-lint
|
2021-01-26 17:35:21 +01:00
|
|
|
env:
|
|
|
|
BUILD_TAGS: kube,e2e
|
2020-05-14 22:13:35 +02:00
|
|
|
run: |
|
2021-01-26 17:35:21 +01:00
|
|
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin/ v1.33.0
|
|
|
|
make -f builder.Makefile lint
|
2020-05-14 22:13:35 +02:00
|
|
|
|
2020-04-30 17:37:41 +02:00
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
2020-05-14 13:35:55 +02:00
|
|
|
env:
|
|
|
|
GO111MODULE: "on"
|
2020-04-30 17:37:41 +02:00
|
|
|
steps:
|
2020-08-12 10:36:09 +02:00
|
|
|
- name: Set up Go 1.15
|
2020-04-30 17:41:59 +02:00
|
|
|
uses: actions/setup-go@v1
|
|
|
|
with:
|
2020-08-12 10:36:09 +02:00
|
|
|
go-version: 1.15
|
2020-04-30 17:41:59 +02:00
|
|
|
id: go
|
|
|
|
|
2021-01-07 19:44:10 +01:00
|
|
|
- name: Setup docker CLI
|
|
|
|
run: |
|
|
|
|
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.2.tgz | tar xz
|
|
|
|
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
|
|
|
|
|
2020-04-30 17:41:59 +02:00
|
|
|
- name: Checkout code into the Go module directory
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2020-06-18 09:44:34 +02:00
|
|
|
- uses: actions/cache@v2
|
2020-05-14 13:35:55 +02:00
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
2020-06-18 09:44:34 +02:00
|
|
|
key: go-${{ hashFiles('**/go.sum') }}
|
2020-04-30 17:37:41 +02:00
|
|
|
|
2020-10-14 10:59:21 +02:00
|
|
|
# Ensure we don't discover cross platform build issues at release time.
|
|
|
|
# Time used to build linux here is gained back in the build for local E2E step
|
2020-10-13 17:12:16 +02:00
|
|
|
- name: Build packages
|
|
|
|
run: make -f builder.Makefile cross
|
|
|
|
|
2020-04-30 17:41:59 +02:00
|
|
|
- name: Test
|
2021-01-26 17:35:21 +01:00
|
|
|
env:
|
|
|
|
BUILD_TAGS: kube
|
2020-05-14 13:35:55 +02:00
|
|
|
run: make -f builder.Makefile test
|
|
|
|
|
2020-10-01 12:21:25 +02:00
|
|
|
- name: Build for local E2E
|
2020-06-15 17:41:59 +02:00
|
|
|
env:
|
2021-01-18 18:35:03 +01:00
|
|
|
BUILD_TAGS: e2e
|
2020-05-14 13:35:55 +02:00
|
|
|
run: make -f builder.Makefile cli
|
2020-05-04 15:10:28 +02:00
|
|
|
|
|
|
|
- name: E2E Test
|
2020-08-18 16:10:34 +02:00
|
|
|
run: make e2e-local
|