nandi/frqpublic Fork 0
4dfc71908cc3f12174bb0d6dd8688ff3164879c3
Commits
Clone
git clone https://git.rickub.com/nandi/frq.git
git clone ssh://git@rickub.com/nandi/frq.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

build.yml · 182 lines · 7.9 KBYAML Blame HistoryRaw
A runner that builds nothing, and an AppImage anyway 41bcb21 nandi 23h ago1# The build, on rickub. GitLab CI next door reads source and no more —
One frontend where there were three, and a core that is not Clojure 438b247 nandi 20h ago2# check-common on every push — and deliberately builds nothing. This is the
3# other half: the web bundle, actually compiled.
A runner that builds nothing, and an AppImage anyway 41bcb21 nandi 23h ago4#
One frontend where there were three, and a core that is not Clojure 438b247 nandi 20h ago5# It is not compiled *here*. The job hands the work to Modal exactly as a
6# person at a terminal would, and the Sandbox does it against the `devshell`
7# volume. What a runner contributes is a checkout, a python, and somewhere to
8# put the result afterwards. The reason it goes to Modal is the volume the
9# toolchain is cached on, not the size of the build.
A runner that builds nothing, and an AppImage anyway 41bcb21 nandi 23h ago10#
11# Lives in .rickub/workflows/ rather than .github/workflows/ because rickub
12# reads one or the other and never both: with this directory present, a
13# .github/workflows/ added later would be silently ignored. There is none
14# today, so nothing is being shadowed — see
15# https://rickub.com/docs/actions and https://rickub.com/docs/migrating-from-github
16name: build
17
18on:
19 push:
20 workflow_dispatch:
21
22jobs:
23 # The same read-only check GitLab runs, for the same reason: common/ compiles
One frontend where there were three, and a core that is not Clojure 438b247 nandi 20h ago24 # for two targets, so a host-specific call in shared code breaks one of them
25 # at a namespace nobody touched. Seconds, no toolchain. Worth having on both
26 # hosts rather than depending on which one a given push reaches.
A runner that builds nothing, and an AppImage anyway 41bcb21 nandi 23h ago27 check-common:
28 runs-on: ubuntu-latest
29 steps:
30 - uses: actions/checkout@v4
31 - run: python3 tools/check-common.py common
32
CI that can actually build the Nim core 1403956 nandi 16h ago33 # The Nim core: its own suite, and the library the Dart job needs.
34 #
No containers for the JS-action jobs 3760746 nandi 16h ago35 # NOT in a `container:`, and that is the whole reason this job is shaped the
36 # way it is. `actions/upload-artifact` is a node20 action and JS actions run
37 # inside the job container, so `nimlang/nim` — which carries no node — failed
38 # the upload step with `node: command not found` after everything real had
39 # already passed. The runner image has node; Nim is what it lacks, and Nim is
40 # the easier of the two to bring.
CI that can actually build the Nim core 1403956 nandi 16h ago41 #
No containers for the JS-action jobs 3760746 nandi 16h ago42 # Pinned by sha256 rather than taken from apt, which is this repo's habit
43 # elsewhere — see `tools/toolchain.sh`, which fetches Flutter, a JDK and the
44 # Clojure CLI the same way. An apt Nim is whatever the distro froze, and
45 # `nim/nim.cfg` needs >= 2.0.
One frontend where there were three, and a core that is not Clojure 438b247 nandi 20h ago46 nim-test:
47 runs-on: ubuntu-latest
No containers for the JS-action jobs 3760746 nandi 16h ago48 env:
49 NIM_VERSION: "2.2.10"
50 NIM_SHA256: "0a3a38752e97e9d44aa479b3a7b37336dfe0176daf22ee5b5218ad0991ecd211"
One frontend where there were three, and a core that is not Clojure 438b247 nandi 20h ago51 steps:
52 - uses: actions/checkout@v4
No containers for the JS-action jobs 3760746 nandi 16h ago53
54 # libssl-dev because `nim/nim.cfg` sets `-d:ssl`: std/net wants OpenSSL
55 # for the TLS on :6697 and `frq.atproto` uses httpclient over the same.
56 - name: OpenSSL headers
57 run: sudo apt-get update -qq && sudo apt-get install -y -qq libssl-dev
58
59 - name: Nim ${{ env.NIM_VERSION }}
60 run: |
61 set -euo pipefail
62 url="https://nim-lang.org/download/nim-${NIM_VERSION}-linux_x64.tar.xz"
63 curl -fsSL -o /tmp/nim.tar.xz "$url"
64 echo "${NIM_SHA256} /tmp/nim.tar.xz" | sha256sum -c -
65 mkdir -p /opt/nim && tar -xJf /tmp/nim.tar.xz -C /opt/nim --strip-components=1
66 echo "/opt/nim/bin" >> "$GITHUB_PATH"
67
CI that can actually build the Nim core 1403956 nandi 16h ago68 - name: The Nim suite
69 run: cd nim && for t in tests/t*.nim; do nim c -r --hints:off --path:src "$t"; done
No containers for the JS-action jobs 3760746 nandi 16h ago70
CI that can actually build the Nim core 1403956 nandi 16h ago71 - name: Build libfrqcore.so
72 run: |
73 cd nim && nim c --app:lib --mm:orc -d:release --hints:off --path:src \
74 --out:../build/nim/libfrqcore.so src/frq_core.nim
No containers for the JS-action jobs 3760746 nandi 16h ago75 # Diagnostic, not a gate. Worth reading: Nim resolves OpenSSL through
76 # dlopen rather than a link-time NEEDED, so libssl will not appear
77 # here and the Dart job still has to have one installed.
CI that can actually build the Nim core 1403956 nandi 16h ago78 objdump -p ../build/nim/libfrqcore.so | grep NEEDED || true
No containers for the JS-action jobs 3760746 nandi 16h ago79
CI that can actually build the Nim core 1403956 nandi 16h ago80 - uses: actions/upload-artifact@v4
81 with:
82 name: libfrqcore
83 path: build/nim/libfrqcore.so
84 if-no-files-found: error
One frontend where there were three, and a core that is not Clojure 438b247 nandi 20h ago85
CI that can actually build the Nim core 1403956 nandi 16h ago86 # The Dart side of the same boundary, on the plain VM — no Flutter, no
No containers for the JS-action jobs 3760746 nandi 16h ago87 # emulator, which is what makes it a second to run.
88 #
89 # No container here either, for the same node reason: `download-artifact` is
90 # a JS action too. Dart comes from its own setup action instead.
91 #
92 # `libssl3` because the .so dlopens OpenSSL at startup and the Dart SDK
93 # carries its own BoringSSL rather than bringing one.
The binding is Dart, and it works f7aea3b nandi 20h ago94 dart-test:
95 runs-on: ubuntu-latest
CI that can actually build the Nim core 1403956 nandi 16h ago96 needs: [nim-test]
No containers for the JS-action jobs 3760746 nandi 16h ago97 env:
98 DART_VERSION: "3.13.4"
99 DART_SHA256: "6487a10df5eab890d746d14a55f4c70bec3c1c0633f51804eb504cbc0fc395bb"
The binding is Dart, and it works f7aea3b nandi 20h ago100 steps:
101 - uses: actions/checkout@v4
No containers for the JS-action jobs 3760746 nandi 16h ago102
103 # The SDK by sha256 rather than `dart-lang/setup-dart`, for the reason
104 # the Nim job pins its tarball: a third-party action is one more thing
105 # that has to resolve on this host, and this one does not have to.
106 - name: Dart ${{ env.DART_VERSION }}
107 run: |
108 set -euo pipefail
109 url="https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip"
110 curl -fsSL -o /tmp/dart.zip "$url"
111 echo "${DART_SHA256} /tmp/dart.zip" | sha256sum -c -
112 sudo unzip -q /tmp/dart.zip -d /opt
113 echo "/opt/dart-sdk/bin" >> "$GITHUB_PATH"
114
115 - run: sudo apt-get update -qq && sudo apt-get install -y -qq libssl3
CI that can actually build the Nim core 1403956 nandi 16h ago116 - uses: actions/download-artifact@v4
117 with:
118 name: libfrqcore
119 path: build/nim
The binding is Dart, and it works f7aea3b nandi 20h ago120 - run: cd dart/frq_core && dart pub get && dart test -r expanded
121
One frontend where there were three, and a core that is not Clojure 438b247 nandi 20h ago122 web:
A runner that builds nothing, and an AppImage anyway 41bcb21 nandi 23h ago123 runs-on: ubuntu-latest
The binding is Dart, and it works f7aea3b nandi 20h ago124 needs: [check-common, nim-test, dart-test]
One frontend where there were three, and a core that is not Clojure 438b247 nandi 20h ago125 # What it spends its time on is the ClojureDart compile and, on a cold
126 # toolchain, fetching the pinned Flutter/JDK/Clojure tarballs.
A Mesa nobody needed, and the AppImage that carried it 9db383c nandi 22h ago127 timeout-minutes: 30
A runner that builds nothing, and an AppImage anyway 41bcb21 nandi 23h ago128 steps:
129 # The container copies `.` — the whole working tree, uncommitted edits
130 # included. On a runner that is whatever the checkout left, so it wants
131 # to be the commit and not a shallow surprise.
132 - uses: actions/checkout@v4
133
134 - uses: actions/setup-python@v5
135 with:
136 python-version: "3.12"
137
138 - run: pip install --disable-pip-version-check modal
139
140 # Two secrets, set under Settings -> Secrets and variables. A Modal
141 # token is the whole of this job's configuration: no nix, no builder,
142 # no cache of its own.
One frontend where there were three, and a core that is not Clojure 438b247 nandi 20h ago143 - name: Build the web bundle, on Modal
A runner that builds nothing, and an AppImage anyway 41bcb21 nandi 23h ago144 env:
145 MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
146 MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
147 # Unpiped on purpose. The image build streams to this client and
148 # nowhere else, and `modal app logs` cannot reach an ephemeral run —
149 # so this terminal is the only place the build is visible. tee, not
150 # tail: a run killed mid-pipe through tail takes its output with it.
Six verbs, and the last of the nix 2e24e64 nandi 16h ago151 run: modal run .modal/web/container.py 2>&1 | tee /tmp/frq-build.log
A runner that builds nothing, and an AppImage anyway 41bcb21 nandi 23h ago152
One frontend where there were three, and a core that is not Clojure 438b247 nandi 20h ago153 # The Sandbox leaves the bundle on the devshell volume rather than
154 # anywhere a runner can see, so fetch it back out.
A Mesa nobody needed, and the AppImage that carried it 9db383c nandi 22h ago155 - name: Fetch the bundle out of the volume
A runner that builds nothing, and an AppImage anyway 41bcb21 nandi 23h ago156 env:
157 MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
158 MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
Fetch the web bundle the way web-local does e505ded nandi 16h ago159 # Into a directory that already exists, which `modal volume get` then
Six verbs, and the last of the nix 2e24e64 nandi 16h ago160 # creates `web/` inside — the same shape `just serve` uses. Naming
Fetch the web bundle the way web-local does e505ded nandi 16h ago161 # `web` as the destination itself is what failed, with `[Errno 21] Is a
162 # directory`, after the Modal build had already succeeded.
A Mesa nobody needed, and the AppImage that carried it 9db383c nandi 22h ago163 run: |
Fetch the web bundle the way web-local does e505ded nandi 16h ago164 mkdir -p dist
A Mesa nobody needed, and the AppImage that carried it 9db383c nandi 22h ago165 modal volume get --force devshell \
Six verbs, and the last of the nix 2e24e64 nandi 16h ago166 frq-web/flutter/build/web dist
A runner that builds nothing, and an AppImage anyway 41bcb21 nandi 23h ago167
168 - uses: actions/upload-artifact@v4
169 with:
One frontend where there were three, and a core that is not Clojure 438b247 nandi 20h ago170 name: frq-web-${{ github.sha }}
Fetch the web bundle the way web-local does e505ded nandi 16h ago171 path: dist/web
172 if-no-files-found: error
A runner that builds nothing, and an AppImage anyway 41bcb21 nandi 23h ago173 if-no-files-found: error
174
175 # Kept whether or not the build succeeded: a failed run's log is the
176 # one most worth reading, and it is gone with the runner otherwise.
177 - uses: actions/upload-artifact@v4
178 if: always()
179 with:
180 name: build-log
181 path: /tmp/frq-build.log
182 if-no-files-found: ignore