Skip to content

Commit 6f3d039

Browse files
committed
- fix: update CI workflow to use Makefile commands for vetting, formatting, and testing; streamline build process with PACKAGES env variable
1 parent 45ec79d commit 6f3d039

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
# every OS/arch consumers ship on. The cross-compile job exists specifically to
55
# catch platform-portability regressions (e.g. Unix-only syscalls) at the
66
# source, before they reach downstream binaries.
7+
#
8+
# Scope matches the Makefile's PACKAGES (library packages only). The examples/
9+
# tree is excluded because some examples depend on generated, gitignored files
10+
# (e.g. portable-embedded-agent/secrets_gen.go).
711
name: CI
812

913
on:
@@ -27,6 +31,9 @@ on:
2731
permissions:
2832
contents: read
2933

34+
env:
35+
PACKAGES: ./sdk/... ./agent/... ./types/... ./internal/...
36+
3037
jobs:
3138
check:
3239
name: Build, Vet & Test
@@ -42,20 +49,16 @@ jobs:
4249
cache: true
4350

4451
- name: Vet
45-
run: go vet ./...
52+
run: make vet
4653

4754
- name: Format check
48-
run: |
49-
unformatted=$(gofmt -l $(find . -name '*.go' -not -path './types/types.go'))
50-
if [ -n "$unformatted" ]; then
51-
echo "Files not formatted:"; echo "$unformatted"; exit 1
52-
fi
55+
run: make fmt-check
5356

5457
- name: Test
55-
run: go test -race -count=1 ./...
58+
run: make test
5659

5760
- name: Build
58-
run: go build ./...
61+
run: go build ${{ env.PACKAGES }}
5962

6063
cross-compile:
6164
name: Cross-compile (${{ matrix.goos }}/${{ matrix.goarch }})
@@ -91,4 +94,4 @@ jobs:
9194
GOOS: ${{ matrix.goos }}
9295
GOARCH: ${{ matrix.goarch }}
9396
CGO_ENABLED: '0'
94-
run: go build ./...
97+
run: go build ${{ env.PACKAGES }}

0 commit comments

Comments
 (0)