-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (63 loc) · 1.41 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
name: ci
on:
push:
tags:
- v*
pull_request:
jobs:
tests:
name: Unit Tests
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
check-latest: true
cache: true
- name: Run Tests
run: |
make test
lint:
name: Lint Code
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
check-latest: true
cache: true
- name: Run Linter
uses: golangci/golangci-lint-action@v3
with:
args: --timeout 5m
release:
name: Release
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/')
needs:
- tests
- lint
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
check-latest: true
- name: Install Ko
uses: imjasonh/[email protected]
- name: Release a New Version
run: make ci_release
env:
RELEASE_TAG: ${{github.ref_name}}
GH_TOKEN: ${{ github.token }}