-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (79 loc) · 2.03 KB
/
pr.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
name: CI
on:
pull_request:
tags:
- v*
branches:
- main
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
cache: false
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: '--config=.golangci.yaml -v'
- name: Check undetected changes
run: |-
REPO_STATUS="$(git status --porcelain)"
if [[ ! -z $REPO_STATUS ]]; then
echo "::error::Uncommitted changes detected"
echo "$REPO_STATUS"
git status -vv
exit 1
fi
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- uses: actions/checkout@v3
- name: Run make test
run: make test
compile:
name: Build
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- uses: actions/checkout@v3
- name: Run make generate deps compile test install
run: make generate deps compile test install
- name: Check undetected changes
run: |-
REPO_STATUS="$(git status --porcelain)"
if [[ ! -z $REPO_STATUS ]]; then
echo "::error::Uncommitted changes detected"
echo "$REPO_STATUS"
git status -vv
exit 1
fi
generate:
name: Generate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run make generate
run: make generate
- name: Check undetected changes
run: |-
REPO_STATUS="$(git status --porcelain)"
if [[ ! -z $REPO_STATUS ]]; then
echo "::error::Uncommitted changes detected"
echo "$REPO_STATUS"
git status -vv
exit 1
fi