-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.18 KB
/
ci.yml
File metadata and controls
55 lines (46 loc) · 1.18 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
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: stable
cache: true
- name: Check go mod tidy
run: |
go mod tidy
git diff --exit-code go.mod go.sum
- name: Check goimports
run: |
go install golang.org/x/tools/cmd/goimports@v0.28.0
diff=$(goimports -l -local github.com/fbsobreira/gotron-examples .)
if [ -n "$diff" ]; then
echo "Files need goimports formatting:"
echo "$diff"
exit 1
fi
- name: golangci-lint
run: |
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6
golangci-lint run ./...
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: stable
cache: true
- name: Build all examples
run: go build ./...