-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (105 loc) · 4.23 KB
/
Copy pathci.yml
File metadata and controls
109 lines (105 loc) · 4.23 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
98
99
100
101
102
103
104
105
106
107
108
109
name: CI
on:
# push only on main; PR branches are covered by pull_request. Scoping push this
# way avoids the double run (a push to a branch with an open PR otherwise fires
# both events — now doubly wasteful with the ~7-min xbuild job below).
push:
branches: [main]
pull_request:
# libtile57 is the sole engine: the build is CGO and statically links the native
# lib from the public beetlebugorg/tile57 repo, built with Zig 0.16. That repo is
# the ./tile57 git submodule (go.mod's replace points at ./tile57/bindings/go, and
# the binding's cgo LDFLAGS at its zig-out/lib); its own submodules fetch the IHO
# S-101 catalogues. `submodules: recursive` checks it out at the committed pin, then
# we float it to the engine's latest main (the pin is just last-known-good).
# NOTE: correct-by-construction but unvalidated until pushed to GitHub.
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout chartplotter (+ tile57 engine submodule)
uses: actions/checkout@v7
with:
path: chartplotter
submodules: recursive
# Keep building against the engine's latest main (floating); the committed
# submodule pin is just last-known-good. Move tile57 to origin/main, then
# re-sync its nested IHO catalogues to that commit's pins.
- name: Float tile57 submodule to latest main
run: |
git -C chartplotter submodule update --remote tile57
git -C chartplotter submodule update --init --recursive tile57
- uses: actions/setup-go@v6
with:
go-version: '1.26'
cache: true
cache-dependency-path: chartplotter/go.sum
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Build libtile57
run: make -C chartplotter tile57-lib
- name: Format check
run: make -C chartplotter fmt-check
- name: Vet
run: make -C chartplotter vet
- name: Test
run: make -C chartplotter test
- name: Build
run: make -C chartplotter build
govulncheck:
runs-on: ubuntu-latest
steps:
- name: Checkout chartplotter (+ tile57 engine submodule)
uses: actions/checkout@v7
with:
path: chartplotter
submodules: recursive
- name: Float tile57 submodule to latest main
run: |
git -C chartplotter submodule update --remote tile57
git -C chartplotter submodule update --init --recursive tile57
- uses: actions/setup-go@v6
with:
go-version: '1.26'
cache: true
cache-dependency-path: chartplotter/go.sum
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Build libtile57
run: make -C chartplotter tile57-lib
- name: Vulnerability scan
run: cd chartplotter && go run golang.org/x/vuln/cmd/govulncheck@latest ./...
# Cross-compile the CGO binary for every release target (linux + windows,
# amd64/arm64) with `zig cc`, the same path release.yml runs on a v* tag. Kept
# here on push/PR so a cross-compile break (e.g. an engine change that only
# fails to build for windows) is caught before tagging, not during the release.
xbuild:
runs-on: ubuntu-latest
steps:
- name: Checkout chartplotter (+ tile57 engine submodule)
uses: actions/checkout@v7
with:
path: chartplotter
submodules: recursive
- name: Float tile57 submodule to latest main
run: |
git -C chartplotter submodule update --remote tile57
git -C chartplotter submodule update --init --recursive tile57
- uses: actions/setup-go@v6
with:
go-version: '1.26'
cache: true
cache-dependency-path: chartplotter/go.sum
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
# Builds libtile57 per target with zig, then links each binary with `zig cc`,
# emitting dist/chartplotter_${goos}_${goarch}${ext} for linux+windows
# amd64/arm64. No artifact upload — this is a build-health gate, not a release.
- name: Cross-build linux + windows binaries
run: make -C chartplotter xbuild TILE57=tile57 VERSION="ci"