-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
55 lines (46 loc) · 1.15 KB
/
go.yml
File metadata and controls
55 lines (46 loc) · 1.15 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: Go CI
on:
push:
branches: [main]
paths:
- 'lantern-core/**'
- 'go.mod'
- 'go.sum'
- '.github/workflows/go.yml'
pull_request:
paths:
- 'lantern-core/**'
- 'go.mod'
- 'go.sum'
- '.github/workflows/go.yml'
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Verify Go version
run: go version
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/Library/Caches/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
run: go mod download
- name: Run gofmt
run: |
UNFORMATTED=$(gofmt -l .)
if [[ -n "$UNFORMATTED" ]]; then
echo "Files not formatted:"
echo "$UNFORMATTED"
exit 1
fi
- name: Run tests
run: CGO_ENABLED=1 go test -v -tags with_clash_api,with_conntrack ./...