Skip to content

Commit

Permalink
workflows: windows package
Browse files Browse the repository at this point in the history
  • Loading branch information
mtzguido committed Jan 18, 2025
1 parent 86310ec commit 4139862
Showing 1 changed file with 128 additions and 2 deletions.
130 changes: 128 additions & 2 deletions .github/workflows/package-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,133 @@ defaults:
shell: bash

jobs:
nop:
fstar-src:
## NOTE: This is copied from build-src in the F* repo.

runs-on: ubuntu-22.04
# We prefer slightly older Ubuntu so we get binaries that work on
# all more recent versions.
steps:
- uses: actions/checkout@master
id: checkout
with:
repository: ${{inputs.fstar_repo}}
ref: ${{inputs.fstar_ref}}

- name: Check cache
id: check-cache
uses: actions/cache/restore@v4
with:
path: fstar-src.tar.gz
key: FStar-src-${{steps.checkout.outputs.commit}}

- uses: ocaml/setup-ocaml@v3
if: steps.check-cache.outputs.cache-hit != 'true'
with:
ocaml-compiler: 4.14.2

- name: Prepare
if: steps.check-cache.outputs.cache-hit != 'true'
run: |
./.scripts/get_fstar_z3.sh $HOME/bin
echo "PATH=$HOME/bin:$PATH" >> $GITHUB_ENV
opam install --deps-only ./fstar.opam
- name: Set F* version
if: steps.check-cache.outputs.cache-hit != 'true'
run: |
echo FSTAR_VERSION="$(git describe --tags --dirty)" >> $GITHUB_ENV
# NB: release workflow later adds version number to the name
- name: Build package
if: steps.check-cache.outputs.cache-hit != 'true'
run: |
eval $(opam env)
export FSTAR_TAG=
# ^ no tag in source package
make -skj$(nproc) package-src ADMIT=1
- name: Save
if: steps.check-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: fstar-src.tar.gz
key: FStar-src-${{steps.checkout.outputs.commit}}

- uses: actions/upload-artifact@v4
with:
path: fstar-src.tar.gz
name: package-src

fstar-binary:
runs-on: [self-hosted, windows, X64, opam-2-3]
needs: fstar-src
steps:
- run: exit 0
- name: clean
shell: C:\cygwin64\bin\bash.exe --login '{0}'
run: cd $GITHUB_WORKSPACE/ && rm -rf * && echo "There is a CR at the end of this line"

- uses: actions/download-artifact@v4
with:
name: package-src

# - name: Check cache
# id: check-cache
# uses: actions/cache/restore@v4
# with:
# path: fstar.zip
# key: FStar-${{runner.os}}-${{ hashFiles('/fstar-src.tar.gz') }}

- run: cd $GITHUB_WORKSPACE && tar xzf fstar-src.tar.gz && echo
# if: steps.check-cache.outputs.cache-hit != 'true'
shell: C:\cygwin64\bin\bash.exe --login '{0}'

- name: Build a package
# if: steps.check-cache.outputs.cache-hit != 'true'
shell: C:\cygwin64\bin\bash.exe --login '{0}'
run: |
cd $GITHUB_WORKSPACE && cd fstar && eval $(opam env) && make clean && CC=x86_64-w64-mingw32-gcc.exe DUNE_CONFIG__BACKGROUND_SANDBOXES=disabled make -j$(nproc) package V=1 ADMIT=1 && mv fstar.zip .. && echo "There is a CR at the end of this line"
# - name: Save
# if: steps.check-cache.outputs.cache-hit != 'true'
# uses: actions/cache/save@v4
# with:
# path: fstar.zip
# key: FStar-${{runner.os}}-${{ hashFiles('/fstar-src.tar.gz') }}

- uses: actions/upload-artifact@v4
with:
name: fstar-package
path: fstar.zip

build:
runs-on: [self-hosted, windows, X64, opam-2-3]
needs: fstar-binary
steps:
- uses: actions/checkout@master
with:
path: karamel
repository: ${{inputs.karamel_repo}}
ref: ${{inputs.karamel_ref}}

- uses: actions/download-artifact@v4
with:
name: fstar-package

- name: Prepare
# opam install --deps-only FStar/fstar.opam
# ^ relying on the fact that F* dependencies are already installed
run: |
eval $(opam env) && sed -i '/"fstar"/d' karamel/karamel.opam && opam install --deps-only karamel/karamel.opam && opam install hex re sexplib && echo
- name: Build package
shell: C:\cygwin64\bin\bash.exe --login '{0}'
run: |
eval $(opam env) && CC=x86_64-w64-mingw32-gcc.exe make -C $GITHUB_WORKSPACE package -kj$(nproc) && echo
- uses: actions/upload-artifact@v4
with:
path: |
everparse*.zip
everparse*.tar.gz
name: everparse

0 comments on commit 4139862

Please sign in to comment.