@@ -12,7 +12,7 @@ defaults:
1212 shell : bash
1313
1414jobs :
15- ci :
15+ ci_ubuntu :
1616 runs-on : ubuntu-latest
1717 container : mtzguido/dev-base
1818 steps :
@@ -88,3 +88,167 @@ jobs:
8888 - name : Pulse CI
8989 id : cistep
9090 run : . $HOME/.cargo/env && make -C pulse ci -skj$(nproc)
91+
92+ # Build (and cache) an F* source package on Linux, to be consumed by the
93+ # Windows job below. F* cannot be built directly from a git checkout on
94+ # Windows, so we ship an OCaml source package instead, exactly as
95+ # EverParse's package-windows workflow does.
96+ fstar_src :
97+ runs-on : ubuntu-22.04
98+ # Slightly older Ubuntu, so the produced package works on more systems.
99+ steps :
100+ - uses : actions/checkout@master
101+ id : checkout-fstar
102+ with :
103+ repository : FStarLang/FStar
104+ ref : fstar1
105+
106+ - name : Try fetch built F* source package
107+ id : check-cache
108+ uses : actions/cache/restore@v4
109+ with :
110+ path : fstar-src.tar.gz
111+ key : FStar-src-${{ steps.checkout-fstar.outputs.commit }}
112+
113+ - uses : ocaml/setup-ocaml@v3
114+ if : steps.check-cache.outputs.cache-hit != 'true'
115+ with :
116+ ocaml-compiler : 4.14.2
117+
118+ - name : Prepare
119+ if : steps.check-cache.outputs.cache-hit != 'true'
120+ run : |
121+ ./.scripts/get_fstar_z3.sh $HOME/bin
122+ echo "PATH=$HOME/bin:$PATH" >> $GITHUB_ENV
123+ opam install --deps-only ./fstar.opam
124+
125+ - name : Set F* version
126+ if : steps.check-cache.outputs.cache-hit != 'true'
127+ run : echo FSTAR_VERSION="$(git describe --tags --always --dirty 2>/dev/null || echo unknown)" >> $GITHUB_ENV
128+
129+ - name : Build the F* source package
130+ if : steps.check-cache.outputs.cache-hit != 'true'
131+ run : |
132+ eval $(opam env)
133+ export FSTAR_TAG=
134+ # ^ no tag in the source package: produces fstar-src.tar.gz
135+ make -skj$(nproc) package-src ADMIT=1
136+
137+ - name : Save built F* source package
138+ if : steps.check-cache.outputs.cache-hit != 'true'
139+ uses : actions/cache/save@v4
140+ with :
141+ path : fstar-src.tar.gz
142+ key : FStar-src-${{ steps.checkout-fstar.outputs.commit }}
143+
144+ - uses : actions/upload-artifact@v4
145+ with :
146+ path : fstar-src.tar.gz
147+ name : fstar-src
148+
149+ # Windows CI: build F* from the source package above, build karamel from
150+ # source, then run the full Pulse `ci` rule under Cygwin. This is what
151+ # exercises the symlink-free build on a platform without symlink support.
152+ ci_windows :
153+ needs : fstar_src
154+ runs-on : windows-2025
155+ steps :
156+ - name : Use LF checkouts
157+ run : git config --global core.autocrlf input
158+
159+ - uses : actions/checkout@v4
160+ with :
161+ path : pulse
162+
163+ - uses : actions/checkout@v4
164+ with :
165+ repository : FStarLang/karamel
166+ ref : d6607b99477640cb1e5d423d5cbe709d76da61f7
167+ path : karamel
168+
169+ - name : Set up OCaml (also installs Cygwin)
170+ uses : ocaml/setup-ocaml@v3
171+ with :
172+ ocaml-compiler : 5.3.0
173+
174+ - name : Install Cygwin packages
175+ shell : C:\.opam\.cygwin\root\bin\bash.exe --login '{0}'
176+ env :
177+ CYGWIN_ROOT : C:\.opam\.cygwin\root
178+ CYGWIN_MIRROR : https://mirrors.kernel.org/sourceware/cygwin/
179+ run : >-
180+ "$GITHUB_WORKSPACE"/pulse/.github/windows/install-cygwin-packages.sh
181+
182+ - name : Download F* source package
183+ uses : actions/download-artifact@v4
184+ with :
185+ name : fstar-src
186+
187+ - name : Build F* from the source package
188+ shell : C:\.opam\.cygwin\root\bin\bash.exe --login '{0}'
189+ run : |
190+ cd "$GITHUB_WORKSPACE"
191+ tar xzf fstar-src.tar.gz
192+ cd fstar
193+ ./get_fstar_z3.sh "$HOME/bin"
194+ export PATH="$HOME/bin:$PATH"
195+ eval $(opam env)
196+ opam install --deps-only --yes ./fstar.opam
197+ make -j$(nproc)
198+
199+ - name : Build karamel
200+ shell : C:\.opam\.cygwin\root\bin\bash.exe --login '{0}'
201+ run : |
202+ cd "$GITHUB_WORKSPACE"
203+ export FSTAR_EXE="$(pwd)/fstar/out/bin/fstar.exe"
204+ export PATH="$HOME/bin:$PATH"
205+ eval $(opam env)
206+ cd karamel
207+ # karamel.opam lists fstar as a dependency, but we build F*
208+ # ourselves above, so drop it before installing the rest.
209+ grep -v '"fstar"' karamel.opam > karamel-deps.opam
210+ opam install --deps-only --yes ./karamel-deps.opam
211+ make -j$(nproc)
212+
213+ - name : Install domainslib (for the task pool test)
214+ shell : C:\.opam\.cygwin\root\bin\bash.exe --login '{0}'
215+ run : |
216+ cd "$GITHUB_WORKSPACE"
217+ eval $(opam env)
218+ opam install --yes domainslib
219+
220+ - name : Pulse CI
221+ shell : C:\.opam\.cygwin\root\bin\bash.exe --login '{0}'
222+ run : |
223+ cd "$GITHUB_WORKSPACE"
224+ # Use Windows/mixed ("D:/...") paths for KRML_HOME (and FSTAR_EXE): the
225+ # C compiler KaRaMeL drives is native mingw gcc and `krml` is a native
226+ # Windows binary, neither of which understands Cygwin ("/cygdrive/...")
227+ # paths. Without this, krml passes "-I /cygdrive/.../karamel/include" to
228+ # mingw cc and krmllib.h is not found.
229+ workspace_w="$(cygpath -m "$(pwd)")"
230+ export FSTAR_EXE="$workspace_w/fstar/out/bin/fstar.exe"
231+ export KRML_HOME="$workspace_w/karamel"
232+ export PATH="$HOME/bin:$PATH"
233+ eval $(opam env)
234+ cd pulse
235+ # PULSE_NO_RUST=1: skip the pulse2rust tool and its tests, which are
236+ # the only parts of `ci` that need a Rust toolchain.
237+ make -j$(nproc) -k ci PULSE_NO_RUST=1
238+
239+ ci :
240+ name : CI success
241+ if : always()
242+ needs : [ci_ubuntu, ci_windows]
243+ runs-on : ubuntu-latest
244+ steps :
245+ - name : Verify all jobs succeeded
246+ run : |
247+ echo "Ubuntu: ${{ needs.ci_ubuntu.result }}"
248+ echo "Windows: ${{ needs.ci_windows.result }}"
249+ if [ "${{ needs.ci_ubuntu.result }}" != "success" ] || [ "${{ needs.ci_windows.result }}" != "success" ]
250+ then
251+ echo "One or more CI jobs failed."
252+ exit 1
253+ fi
254+ echo "All CI jobs passed."
0 commit comments