-
Notifications
You must be signed in to change notification settings - Fork 104
72 lines (56 loc) · 1.89 KB
/
ci.yaml
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
64
65
66
67
68
69
70
71
72
name: EC2 Instance Selector CI and Release
on: [push, pull_request, workflow_dispatch]
env:
DEFAULT_GO_VERSION: ^1.18
GITHUB_USERNAME: ${{ secrets.EC2_BOT_GITHUB_USERNAME }}
GITHUB_TOKEN: ${{ secrets.EC2_BOT_GITHUB_TOKEN }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
jobs:
buildAndTest:
name: Build and Test
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ${{ env.DEFAULT_GO_VERSION }}
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Unit Tests
run: make unit-test
- name: Lints
run: make spellcheck shellcheck
- name: Brew Sync Dry run
run: make homebrew-sync-dry-run
- name: License Test
run: make license-test
- name: Build Binaries
run: make build-binaries
- name: Build Docker Images
run: make build-docker-images
- name: Integration Tests
if: ${{ github.event_name == 'push' && !contains(github.ref, 'dependabot') }}
run: make integ-test
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }}
AWS_REGION: ${{ secrets.AWS_REGION }}
release:
name: Release
runs-on: ubuntu-20.04
needs: [buildAndTest]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ${{ env.DEFAULT_GO_VERSION }}
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Release Assets
run: make release
- name: Sync to Homebrew
run: make homebrew-sync