forked from tenable/terrascan
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (49 loc) · 1.38 KB
/
gobuild.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: build
on:
push:
pull_request:
jobs:
validate:
runs-on: ubuntu-latest
env:
GO111MODULE: on
GOPATH: /home/runner/work/terrascan
GOBIN: /home/runner/work/terrascan/bin
GO_VERSION: 1.16
steps:
- name: Checkout Terrascan
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: ${{ env.GO_VERSION }}
- name: Install golint
run: go get -u golang.org/x/lint/golint
- name: Go validations
run: make validate
- name: Build Terrascan
run: make build
- name: Run unit tests
run: make unit-tests
- name: install kind
run: make install-kind
- name: Run e2e tests
run: make e2e-tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
# push image to Docker Hub
push:
# Ensure "validate" job passes before pushing image.
needs: validate
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout Terrascan
uses: actions/checkout@v2
- name: Build Terrascan docker image
run: make docker-build
- name: Login to docker hub
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u accurics --password-stdin
- name: Push Terrascan latest docker image
if: ${{ github.ref == 'refs/heads/master' }}
run: make docker-push-latest