-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (72 loc) · 2.01 KB
/
Copy pathbuild.yml
File metadata and controls
87 lines (72 loc) · 2.01 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Test builds on push and PR
name: Build Test
on:
push:
branches: [ "stable", "dev" ]
pull_request:
branches: [ "stable", "dev" ]
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.25']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
- name: Verify dependencies
run: go mod verify
- name: Build (standard)
run: go build -v -o ping-007-test ./cmd/ping-007/
- name: Build (no-c2 variant)
run: go build -v -tags noc2 -o ping-007-noc2-test ./cmd/ping-007/
- name: Test binary
run: ./ping-007-test --version
- name: Test no-c2 binary
run: ./ping-007-noc2-test --version
- name: Vet
run: go vet ./...
- name: Run tests (race detector)
run: go test -race -v ./...
cross-platform:
name: Cross Platform Build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: linux
goarch: amd64
name: ping-007-linux-amd64
- goos: linux
goarch: arm64
name: ping-007-linux-arm64
- goos: windows
goarch: amd64
name: ping-007-windows-amd64.exe
- goos: darwin
goarch: amd64
name: ping-007-darwin-amd64
- goos: darwin
goarch: arm64
name: ping-007-darwin-arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
check-latest: true
- name: Build for ${{ matrix.goos }}/${{ matrix.goarch }}
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
go build -v -ldflags="-s -w" -o ${{ matrix.name }} ./cmd/ping-007/