-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (62 loc) · 2.6 KB
/
Copy pathci.yml
File metadata and controls
72 lines (62 loc) · 2.6 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
name: CI
# Build the compiler from source, verify the self-hosting fixpoint, and compile
# + run the examples — on every push and pull request, so regressions surface
# before a release tag rather than at release time.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14] # glibc/gcc and Darwin/clang
env:
GH_TOKEN: ${{ github.token }} # fetch-seed.sh: GitHub API for the seed
steps:
- uses: actions/checkout@v4
# examples/stdlib/sqlite_demo.xi links libsqlite3 (the FFI demo). macOS ships it
# in the SDK; Ubuntu needs the -dev package for the linker.
- name: Install example dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev
- name: Bootstrap (download seed, compile, self-rebuild)
run: ./compiler/bootstrap.sh
- name: Self-hosting fixpoint
run: ./compiler/selfhost.sh
- name: Compile and run examples
run: |
set -euo pipefail
export XC_RUNTIME="$PWD/runtime"
for f in $(find examples -name '*.xi' -not -path 'examples/showcase/*' | sort) examples/showcase/main.xi; do
echo "== $f =="
case "$(basename "$f")" in
# *_test.xi files have no entry — they run via `xi test` below.
*_test.xi) echo " (test file — run via xi test)"; continue ;;
esac
./compiler/xc "$f" >/dev/null
bin="build/$(basename "${f%.xi}")"
case "$(basename "$f")" in
# Long-running demos block forever (web.serve / the cron scheduler) —
# compile only.
web_demo.xi|web_store_demo.xi|web_params_demo.xi|web_capture_demo.xi|web_route_capture_demo.xi|web_route_move_demo.xi|scheduled_demo.xi|scheduled_every_demo.xi) echo " (long-running example — compile-only)" ;;
*) if [ -x "$bin" ]; then "$bin" | head -3 || true; fi ;;
esac
done
- name: Run unit tests (xi test)
run: |
set -euo pipefail
export XC="$PWD/compiler/xc" XC_RUNTIME="$PWD/runtime"
for f in $(find examples -name '*_test.xi' | sort); do
echo "== xi test $f =="
./bin/xi test "$f"
done
- name: Web route integration test (multi-param + trailing literal)
run: ./scripts/web_route_test.sh