-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (65 loc) · 1.92 KB
/
ci.yml
File metadata and controls
71 lines (65 loc) · 1.92 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
name: ci
on:
push:
branches: [main]
pull_request:
jobs:
build-and-test:
name: ${{ matrix.os }} / Go ${{ matrix.go }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# go-fitz uses cgo + MuPDF; ubuntu-latest ships gcc & mesa headers.
# macOS / windows runners are not validated as part of the CI
# baseline because the production code path also requires Mono +
# NeoLABNcodeSDK.dll, which CI cannot provision. Cross-build is
# exercised in a separate job below.
os: [ubuntu-latest]
go: ["1.25"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: true
- name: gofmt
run: |
out=$(gofmt -l .)
if [ -n "$out" ]; then
echo "::error::gofmt found unformatted files:"
echo "$out"
exit 1
fi
- name: go vet
run: go vet ./...
- name: go test
run: go test ./... -timeout 5m
cross-build:
name: cross-build / ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Compile-only cross-targets. Cgo is disabled here since the
# baseline runner doesn't have cross toolchains for MuPDF; this
# exercises the non-pdf packages on every supported GOOS/GOARCH.
target:
- linux/amd64
- linux/arm64
- darwin/arm64
- windows/amd64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.25"
cache: true
- name: build (no-cgo subset)
env:
TARGET: ${{ matrix.target }}
CGO_ENABLED: "0"
run: |
os=${TARGET%/*}
arch=${TARGET#*/}
GOOS=$os GOARCH=$arch go build ./ncode/... ./pattern/... ./examples/discover-tickets/...