-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (84 loc) · 2.15 KB
/
Copy pathci.yml
File metadata and controls
97 lines (84 loc) · 2.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
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
88
89
90
91
92
93
94
95
96
97
# Continuous Integration for the go-sdk.
#
# Runs build, vet, format check and tests, plus a cross-compile matrix across
# every OS/arch consumers ship on. The cross-compile job exists specifically to
# catch platform-portability regressions (e.g. Unix-only syscalls) at the
# source, before they reach downstream binaries.
#
# Scope matches the Makefile's PACKAGES (library packages only). The examples/
# tree is excluded because some examples depend on generated, gitignored files
# (e.g. portable-embedded-agent/secrets_gen.go).
name: CI
on:
push:
branches:
- main
- next
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
pull_request:
branches:
- main
- next
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
permissions:
contents: read
env:
PACKAGES: ./sdk/... ./agent/... ./types/... ./internal/...
jobs:
check:
name: Build, Vet & Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- name: Vet
run: make vet
- name: Format check
run: make fmt-check
- name: Test
run: make test
- name: Build
run: go build ${{ env.PACKAGES }}
cross-compile:
name: Cross-compile (${{ matrix.goos }}/${{ matrix.goarch }})
runs-on: ubuntu-latest
needs: check
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- name: Cross-compile
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: '0'
run: go build ${{ env.PACKAGES }}