Repository navigation
197 lines (185 loc) · 7.53 KB
/
Copy pathci.yml
File metadata and controls
197 lines (185 loc) · 7.53 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: ci
on:
push:
pull_request:
permissions:
contents: read
jobs:
verify-hashes:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: verify vendored hashes
run: ./scripts/verify-original-hashes.sh | tee docs/evidence/hash-verify.txt
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: hash-verify
path: docs/evidence/hash-verify.txt
upstream-live-diff:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: live upstream byte compare
run: ./scripts/fetch-upstream-and-diff.sh | tee docs/evidence/upstream-diff.txt
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: upstream-diff
path: docs/evidence/upstream-diff.txt
fmt:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: install zig 0.16.0
run: |
curl -fsSL https://ziglang.org/download/0.16.0/zig-x86_64-linux-0.16.0.tar.xz -o zig.tar.xz
echo "70e49664a74374b48b51e6f3fdfbf437f6395d42509050588bd49abe52ba3d00 zig.tar.xz" | sha256sum -c -
sudo tar -xJf zig.tar.xz -C /opt
echo "/opt/zig-x86_64-linux-0.16.0" >> "$GITHUB_PATH"
- run: zig build fmt-check
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: install zig 0.16.0
run: |
curl -fsSL https://ziglang.org/download/0.16.0/zig-x86_64-linux-0.16.0.tar.xz -o zig.tar.xz
echo "70e49664a74374b48b51e6f3fdfbf437f6395d42509050588bd49abe52ba3d00 zig.tar.xz" | sha256sum -c -
sudo tar -xJf zig.tar.xz -C /opt
echo "/opt/zig-x86_64-linux-0.16.0" >> "$GITHUB_PATH"
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/.cache/zig
key: zig-${{ runner.os }}-${{ hashFiles('build.zig', 'build.zig.zon', 'src/**') }}
- run: zig build
zig-tests:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: install zig 0.16.0
run: |
curl -fsSL https://ziglang.org/download/0.16.0/zig-x86_64-linux-0.16.0.tar.xz -o zig.tar.xz
echo "70e49664a74374b48b51e6f3fdfbf437f6395d42509050588bd49abe52ba3d00 zig.tar.xz" | sha256sum -c -
sudo tar -xJf zig.tar.xz -C /opt
echo "/opt/zig-x86_64-linux-0.16.0" >> "$GITHUB_PATH"
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/.cache/zig
key: zig-test-${{ runner.os }}-${{ hashFiles('build.zig', 'src/**', 'tests/**') }}
- run: zig build test
- run: zig build test -Dpow-from-right=true
- run: zig build test -Dnat-log=true
- run: zig build test -Dpow-from-right=true -Dnat-log=true
original-suite:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- name: default
flags: ""
- name: pow
flags: "-Dpow-from-right=true"
- name: natlog
flags: "-Dnat-log=true"
- name: pow_natlog
flags: "-Dpow-from-right=true -Dnat-log=true"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: install zig 0.16.0
run: |
curl -fsSL https://ziglang.org/download/0.16.0/zig-x86_64-linux-0.16.0.tar.xz -o zig.tar.xz
echo "70e49664a74374b48b51e6f3fdfbf437f6395d42509050588bd49abe52ba3d00 zig.tar.xz" | sha256sum -c -
sudo tar -xJf zig.tar.xz -C /opt
echo "/opt/zig-x86_64-linux-0.16.0" >> "$GITHUB_PATH"
- name: run original suite
run: |
chmod +x scripts/*.sh
./scripts/run-original-suite.sh ${{ matrix.name }} ${{ matrix.flags }}
env:
CACHE: ${{ runner.temp }}/zig-cache
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: original-suite-${{ matrix.name }}
path: docs/evidence/original-suite-${{ matrix.name }}-*.txt
escape-hatch-count:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: count escape hatches
run: python3 tools/count-escape-hatches.py .
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: escape-hatches
path: docs/evidence/escape-hatches.json
cross-compile:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
target:
- x86_64-linux-gnu
- x86_64-linux-musl
- aarch64-linux-gnu
- x86_64-windows-gnu
- aarch64-macos
- riscv64-linux
- wasm32-wasi
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: install zig 0.16.0
run: |
curl -fsSL https://ziglang.org/download/0.16.0/zig-x86_64-linux-0.16.0.tar.xz -o zig.tar.xz
echo "70e49664a74374b48b51e6f3fdfbf437f6395d42509050588bd49abe52ba3d00 zig.tar.xz" | sha256sum -c -
sudo tar -xJf zig.tar.xz -C /opt
echo "/opt/zig-x86_64-linux-0.16.0" >> "$GITHUB_PATH"
- name: cross build ${{ matrix.target }}
run: zig build -Dtarget=${{ matrix.target }} -Doptimize=ReleaseSmall
- name: record size
run: |
mkdir -p docs/evidence
find zig-out -type f \( -name 'libtinyexpr*' -o -name 'tinyexpr*' \) -printf '%s %p\n' | tee docs/evidence/cross-${{ matrix.target }}.txt
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: cross-${{ matrix.target }}
path: docs/evidence/cross-${{ matrix.target }}.txt
docker-build-and-verify:
runs-on: ubuntu-24.04
needs: [verify-hashes, fmt, zig-tests, original-suite, escape-hatch-count]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: docker compose verify
run: docker compose up --build --abort-on-container-exit verify
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
if: always()
with:
name: docker-evidence
path: docs/evidence/
readme-claims:
runs-on: ubuntu-24.04
needs: [original-suite, escape-hatch-count]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
merge-multiple: true
path: docs/evidence
- name: rebuild scorecard and check README
run: |
python3 tools/count-escape-hatches.py . || true
# Ensure suite transcripts present from artifacts / tree
ls -la docs/evidence || true
python3 tools/scorecard.py .
chmod +x scripts/check-readme-claims.sh
./scripts/check-readme-claims.sh
{
echo "## Scorecard"
echo '```'
python3 -c "import json;print(json.dumps(json.load(open('docs/evidence/scorecard.json')),indent=2))"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
# Seams for later prompts:
# coverage: ...
# fuzz: ...
# enumeration: ...
# alloc-fault: ...
# bench: ...