-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (75 loc) · 3.12 KB
/
Copy pathnative.yml
File metadata and controls
87 lines (75 loc) · 3.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
name: Native Backend (Linux x86-64)
# Opt into Node 24 for JS actions ahead of the 2026-06-16 forced cutoff
# (actions/checkout, upload-artifact, configure-pages still ship Node 20).
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
on:
push:
branches: [main]
paths:
- 'compiler/src/codegen/qbe/**'
- 'cli/src/sigil_cli.ts'
- '.github/workflows/native.yml'
pull_request:
branches: [main]
paths:
- 'compiler/src/codegen/qbe/**'
- 'cli/src/sigil_cli.ts'
- '.github/workflows/native.yml'
jobs:
native-linux-x64:
name: QBE native backend — Linux x86-64
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Install GCC + build QBE 1.2
# qbe isn't in Ubuntu apt and upstream c9x.me removed its release
# tarballs (its git is dumb-HTTP-only). Build the pinned 1.2 from
# Debian's permanently archived orig tarball, verified by sha256.
run: |
sudo apt-get update -qq
sudo apt-get install -y gcc make xz-utils
curl -fsSL --retry 3 -o /tmp/qbe.tar.xz \
https://deb.debian.org/debian/pool/main/q/qbe/qbe_1.2.orig.tar.xz
echo "a6d50eb952525a234bf76ba151861f73b7a382ac952d985f2b9af1df5368225d /tmp/qbe.tar.xz" | sha256sum -c -
mkdir -p /tmp/qbe && tar xf /tmp/qbe.tar.xz -C /tmp/qbe --strip-components=1
make -C /tmp/qbe -j4
sudo make -C /tmp/qbe install
- name: Verify toolchain
run: |
qbe -h 2>&1 | head -3 || true
gcc --version | head -1
cc --version | head -1
# Run the full QBE test suite: unit tests + linker tests + native e2e
# The integration tests that previously skipped will now run with qbe+gcc available.
- name: Run QBE tests (unit + integration + e2e)
working-directory: compiler
run: bun run test:qbe
# Smoke-test the sgl CLI's --native flag end-to-end.
# sgl run --native propagates the program's exit code, so we capture it explicitly.
- name: sgl run --native smoke test (exit 0)
run: |
echo '@fn main := 0;' > /tmp/smoke_zero.si
bun run cli/src/sigil_cli.ts run --native /tmp/smoke_zero.si
echo "Exit code: $?"
- name: sgl run --native smoke test (exit 42 — expect failure captured)
run: |
echo '@fn main := 42;' > /tmp/smoke42.si
bun run cli/src/sigil_cli.ts run --native /tmp/smoke42.si || code=$?
echo "Program exited with code ${code:-0}"
[ "${code:-0}" -eq 42 ] && echo "PASS: got expected exit code 42"
- name: sgl build --native smoke test
run: |
echo '@fn main := 0;' > /tmp/arith.si
bun run cli/src/sigil_cli.ts build --native /tmp/arith.si
# defaultExePath strips the directory; the executable lands in the cwd as ./arith
./arith
echo "Exit code from ./arith: $?"