Repository navigation
91 lines (76 loc) · 3.06 KB
/
Copy pathci.yml
File metadata and controls
91 lines (76 loc) · 3.06 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
# The Go gates for this plugin's own module.
#
# plugin-task ships a real Go module (go.mod + the provider package), so the
# rulebook's "tests that can fail" (R7) requires a gate that actually runs them:
# gofmt, the configured golangci-lint set, go vet, and the unit tests (which
# exercise the dependency closure, CLI parsing, validation, and incremental
# semantics).
name: ci
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v5
with:
go-version-file: candy/plugin-task/go.mod
cache-dependency-path: candy/plugin-task/go.sum
- name: gofmt
working-directory: candy/plugin-task
run: test -z "$(gofmt -l .)"
- name: golangci-lint
uses: golangci/golangci-lint-action@v7
with:
version: v2.13.2
working-directory: candy/plugin-task
- name: go vet
working-directory: candy/plugin-task
run: go vet ./...
- name: go test
working-directory: candy/plugin-task
run: go test ./...
coherence:
# Cheap control, EVERY pull request (~seconds): charly main's OWN sdk/spec pins
# must LEAD this module's requires, or gate-task.sh's build would die fifty errors
# deep inside plugin-box, naming neither this repo nor the cause (plugin-task#14).
# This is the SAME control scripts/gate-task.sh runs against the charly checkout it
# is about to build — one implementation, two callers (R3) — so the failure mode
# that let the gate rot unrunnable is caught at the PR, before merge.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: self-test the coherence control
run: bash scripts/check-coherence.sh --self-test
- name: assert charly main's pins lead this module's requires
run: |
curl -sfL -o "$RUNNER_TEMP/charly-go.mod" \
https://raw.githubusercontent.com/opencharly/charly/main/charly/go.mod
bash scripts/check-coherence.sh "$RUNNER_TEMP/charly-go.mod" \
candy/plugin-task/go.mod "charly main"
gate:
# The repo's ONLY live execution of the five maintenance verbs, and the expensive
# one: it clones charly and builds a real binary with this candy compiled in, then
# drives every verb on real git fixtures. It runs on `main` and on demand — NOT on
# every PR — because the `coherence` job above catches, at the PR, the failure mode
# that let this gate rot unrunnable and unnoticed (plugin-task#14). main is where
# the full live proof runs, on the tree that ships.
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v5
with:
go-version-file: candy/plugin-task/go.mod
cache-dependency-path: candy/plugin-task/go.sum
- name: gate
run: bash scripts/gate-task.sh