-
Notifications
You must be signed in to change notification settings - Fork 17
96 lines (76 loc) · 2.35 KB
/
go.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Go code jobs
on:
push:
branches:
- main
pull_request:
jobs:
source_lint:
runs-on: ubuntu-latest
name: Linting Go code.
steps:
- name: Checkout code into the Go module directory.
uses: actions/checkout@v3
- name: Import environment variables from file
run: cat ".github/env" >> $GITHUB_ENV
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '${{ env.golang-version }}'
cache: true
- name: Run source code linting.
run: make lint
go_multiarch_build:
runs-on: ubuntu-latest
name: Build for all supported archs.
steps:
- name: Checkout code into the Go module directory.
uses: actions/checkout@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Cache for Docker's buildx
uses: actions/cache@v3
with:
path: .buildxcache/
key: ${{ runner.os }}-buildx-${{ hashFiles('**/*.go', 'Dockerfile', 'go.sum') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Snapshot container buid
run: make container-build
go_build_and_test:
runs-on: ubuntu-latest
name: Build the Go Binary and run tests.
steps:
- name: Checkout code into the Go module directory.
uses: actions/checkout@v3
- name: Import environment variables from file
run: cat ".github/env" >> $GITHUB_ENV
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '${{ env.golang-version }}'
cache: true
- name: Build the Go binary.
run: make token-refresher
- name: Check if repo is dirty.
run: git diff --exit-code
- name: Run the tests.
run: make test
build_jsonnet:
runs-on: ubuntu-latest
name: Build jsonnet files.
steps:
- name: Checkout code into the Go module directory.
uses: actions/checkout@v3
- name: Import environment variables from file
run: cat ".github/env" >> $GITHUB_ENV
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '${{ env.golang-version }}'
cache: true
- name: Run source code linting.
run: make manifests
- name: Check if repo is dirty.
run: git diff --exit-code