-
Notifications
You must be signed in to change notification settings - Fork 1
181 lines (163 loc) · 6.12 KB
/
ci.yml
File metadata and controls
181 lines (163 loc) · 6.12 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: ci
on:
push:
branches: [main]
pull_request:
jobs:
build:
name: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
CC: ${{ matrix.os == 'windows-latest' && 'gcc' || 'cc' }}
steps:
- uses: actions/checkout@v4
- name: Compiler version
run: |
$CC --version
# On ubuntu-latest the alt-versions are also available; print
# them so a future regression that's gcc-13-specific (or
# 12-specific) is easier to triage.
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
for v in 12 13 14; do
if command -v gcc-$v >/dev/null; then
gcc-$v --version | head -1
fi
done
fi
- name: Bootstrap mino
# Generates the bundled-source headers and compiles ./mino in
# one step. Anything beyond bootstrap belongs in `./mino task`.
# Tee stderr so a build failure leaves a captured log for the
# post-step summary below; the live step output stays
# unchanged for anyone with log access.
run: |
set -o pipefail
make 2>&1 | tee /tmp/build.log
- name: Surface build failure
# When the build step above fails, post the captured tail on
# the job summary page so anyone with Actions UI access (incl.
# signed-in external contributors) sees what broke without
# having to download artifacts.
if: failure()
run: |
{
echo "## Build failure (${{ matrix.os }})"
echo ''
echo '```'
tail -60 /tmp/build.log 2>/dev/null || echo '(no build log captured)'
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload build log on failure
# Artifacts are downloadable from the Actions page anonymously
# for public repositories, so this is the path for off-repo
# observers (and for the project bot) to see the actual gcc
# error output without needing log-download permission.
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-log-${{ matrix.os }}
path: /tmp/build.log
retention-days: 7
- name: Test
# Run the suite runner directly so stdout streams. `task test`
# wraps the subprocess in sh!, which buffers output until exit;
# under a hang, no diagnostic ever surfaces.
run: ./mino tests/run.clj
# Tests usually finish in seconds; a hang means a deadlock, not
# a slow runner. Cap so we get diagnostic output instead of
# waiting on the 6h job-default timeout.
timeout-minutes: 8
# The Windows test suite has documented divergence: cmd.exe's
# echo emits a trailing space before \n, which the proc-test
# assertions do not strip. Build still must pass; tests are
# informational on Windows until the suite is portable.
continue-on-error: ${{ matrix.os == 'windows-latest' }}
external-test-suite:
name: external-test-suite (clojure-test-suite)
runs-on: ubuntu-latest
needs: build
# The external test suite is a snapshot of jank-lang/clojure-test-suite
# run against the current mino build. Each .cljc file runs in its own
# `./mino` sub-process under a 30s timeout (handled by the driver),
# so a segfault or hang in one file doesn't take down the rest.
# Informational: the job reports the supported / failed / errored
# counts but does not gate merges.
continue-on-error: true
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
path: mino
- name: Checkout clojure-test-suite
uses: actions/checkout@v4
with:
repository: jank-lang/clojure-test-suite
path: clojure-test-suite
- name: Bootstrap mino
working-directory: mino
run: make
- name: Run external suite
working-directory: mino
# The driver expects the suite as a sibling of mino/, which the
# checkout layout above already gives us. tee the output so the
# next step can pull the summary without re-running the suite.
run: |
set -o pipefail
./mino tests/clojure_test_suite.clj 2>&1 \
| tee /tmp/external_suite.log
- name: Surface aggregate counts
# Pull the summary block out of the captured log and post it as
# the job summary so the Actions UI shows pass / fail counts
# without scrolling.
if: always()
run: |
{
echo "## External test suite summary"
echo ''
echo '```'
sed -n '/EXTERNAL TEST SUITE REPORT/,/Per-file raw results/p' \
/tmp/external_suite.log 2>/dev/null \
| head -100 || true
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
perf-gate:
name: perf-gate (linux)
runs-on: ubuntu-latest
needs: build
# Shared GitHub-hosted runners are CPU-noisy and the runner image
# itself drifts (ubuntu-latest tracks the newest stable image), so
# the perf-gate is informational here. Local runs and the dedicated
# mino-bench workflow remain the authoritative signal.
continue-on-error: true
steps:
- name: Checkout mino at current SHA
uses: actions/checkout@v4
with:
path: mino-head
- name: Checkout mino-bench
uses: actions/checkout@v4
with:
repository: leifericf/mino-bench
path: mino-bench
submodules: recursive
- name: Override mino submodule to this SHA
working-directory: mino-bench
run: |
rm -rf mino
cp -R ../mino-head mino
- name: Bootstrap mino
working-directory: mino-bench/mino
run: make
- name: Build bench binaries
working-directory: mino-bench
run: ./mino/mino task build
- name: Run perf gate
working-directory: mino-bench
run: ./mino/mino task perf-gate