-
Notifications
You must be signed in to change notification settings - Fork 4
93 lines (86 loc) · 2.42 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: CI
on:
pull_request:
branches:
- main
paths-ignore:
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
- "charts/**"
- "docs/**"
- "hack/**"
- "*.md"
pull_request_target:
types:
- closed
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read # for actions/checkout to fetch code
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: actions/setup-go@v4
with:
go-version: 1.20.x
cache: true
- name: Prepare
run: |
echo "machine github.com login ${{ github.actor }} password ${{ secrets.BUILD_BOT_TOKEN }}" > ~/.netrc
- name: Lint
run: make lint
lint-chart:
runs-on: ubuntu-latest
steps:
- run: 'echo "No lint for Helm chart required"'
verify-tidy:
runs-on: ubuntu-latest
permissions:
contents: read # for actions/checkout to fetch code
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: actions/setup-go@v4
with:
go-version: 1.20.x
cache: true
- name: Prepare
run: |
echo "machine github.com login ${{ github.actor }} password ${{ secrets.BUILD_BOT_TOKEN }}" > ~/.netrc
- name: Verify
run: make verify-tidy
test:
runs-on: ubuntu-latest
permissions:
contents: read # for actions/checkout to fetch code
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: actions/setup-go@v4
with:
go-version: 1.20.x
cache: true
- name: Prepare
run: |
echo "machine github.com login ${{ github.actor }} password ${{ secrets.BUILD_BOT_TOKEN }}" > ~/.netrc
- name: Test
run: make test
build:
runs-on: ubuntu-latest
permissions:
contents: read # for actions/checkout to fetch code
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: actions/setup-go@v4
with:
go-version: 1.20.x
cache: true
- name: Prepare # .netrc is used by docker-build, ~/.netrc is used by go test
run: echo "machine github.com login ${{ github.actor }} password ${{ secrets.BUILD_BOT_TOKEN }}" | tee ~/.netrc .netrc
- name: Build
run: make docker-build