-
Notifications
You must be signed in to change notification settings - Fork 15
187 lines (164 loc) · 6.28 KB
/
package-windows.yml
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: Build everparse package (windows)
on:
workflow_dispatch:
inputs:
fstar_repo:
description: F* repository (use org/repo for Github repos)
default: 'FStarLang/FStar'
type: string
required: true
fstar_ref:
description: F* ref (branch, or tag, or commit hash)
default: 'master'
type: string
required: true
karamel_repo:
description: Karamel repository (use org/repo for Github repos)
default: 'FStarLang/karamel'
type: string
required: true
karamel_ref:
description: Karamel ref (branch, or tag, or commit hash)
default: 'master'
type: string
required: true
jobs:
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:
- 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
- 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
if: false
# Disabling this, I get
# Error: Package karamel has no version opam.
# but karamel.opam should refer to the file? This also did not
# work with karamel/karamel.opam (without cd'ing).
shell: C:\cygwin64\bin\bash.exe --login '{0}'
run: |
cd $GITHUB_WORKSPACE && eval $(opam env) && cd karamel && sed -i '/"fstar"/d' karamel.opam && opam install --deps-only karamel.opam && opam install hex re sexplib && echo ""
- name: Build package
shell: C:\cygwin64\bin\bash.exe --login '{0}'
run: |
cd $GITHUB_WORKSPACE && eval $(opam env) && CC=x86_64-w64-mingw32-gcc.exe make nuget-noversion -kj$(nproc) && echo ""
- uses: actions/upload-artifact@v4
with:
path: |
everparse
name: everparse
- uses: actions/upload-artifact@v4
with:
path: |
EverParse*.nupkg
name: everparse-nupkg
test:
needs: build
runs-on: windows-latest
steps:
- name: Download and extract artifact
uses: actions/download-artifact@v4
with:
name: everparse
path: ${{ github.workspace }}\test
- name: Check out repo
uses: actions/checkout@v4
with:
sparse-checkout: src\3d\tests
path: ${{ github.workspace }}\everparse
- name: Test EverParse
shell: cmd
run: |
${{ github.workspace }}\test\everparse.cmd ${{ github.workspace }}\everparse\src\3d\tests\Arithmetic.3d ${{ github.workspace }}\everparse\src\3d\tests\FieldDependence0.3d && ${{ github.workspace }}\test\everparse.cmd ${{ github.workspace }}\everparse\src\3d\tests\Comments.3d && ${{ github.workspace }}\test\everparse.cmd --check_hashes inplace ${{ github.workspace }}\everparse\src\3d\tests\Comments.3d