Repository navigation
77 lines (62 loc) · 1.9 KB
/
Copy pathci.yml
File metadata and controls
77 lines (62 loc) · 1.9 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
name: CI
permissions:
contents: read
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# The one gate: the same `make check` a developer runs locally. The linter
# is installed at the pinned version so a missing tool fails the job
# instead of silently skipping, and a new linter release cannot turn a
# green tree red on its own.
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- name: Install golangci-lint (pinned)
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6
- name: make check
run: make check
- name: CLI smoke test
run: make smoke
test:
strategy:
# Run every platform even if one fails: on a cross-platform TUI, a
# fail-fast matrix hides the platform that actually broke.
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- name: go vet
run: go vet ./...
- name: go test
run: go test ./... -race -count=1
# Cross-compilation is checked explicitly: the README promises no cgo in the
# core path and release artifacts are built CGO-free for six targets.
# This is compile evidence only; runtime behaviour is covered per-OS above.
cross-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- name: cross-compile release targets
run: make cross