-
Notifications
You must be signed in to change notification settings - Fork 13
65 lines (58 loc) · 1.73 KB
/
pr.yml
File metadata and controls
65 lines (58 loc) · 1.73 KB
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
name: Build PR
on:
pull_request:
branches:
- main
- "lts/v0.24"
- "feat/*"
permissions:
contents: read
jobs:
check:
name: Go Workspace Check
runs-on: ubuntu-latest
# Exlude dependabot from this check--it can't run make update-workspace,
# We'll just force the next PR author to do it instead for now
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Set go version
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
with:
go-version-file: 'go.mod'
- name: Update workspace
run: make update-workspace
- name: Check for go mod & workspace changes
run: |
if ! git diff --exit-code --quiet; then
echo "Changes detected:"
git diff
echo "Please run 'make update-workspace' and commit the changes."
exit 1
fi
lint:
runs-on: ubuntu-latest
steps:
# git checkout
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
persist-credentials: false
# go env
- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
with:
go-version-file: 'go.mod'
# make lint
- name: Lint
uses: golangci/golangci-lint-action@b002b6ecfcabe6ac0e2c6cba1bcc779eb34ac51f # v9
with:
version: v2.5.0
only-new-issues: true
args: --timeout 5m $(go list -f '{{.Dir}}/...' -m | tr '\n' ' ')
test:
uses: ./.github/workflows/test.yml