1010 uses : ocaml/setup-ocaml@v2
1111 with :
1212 ocaml-compiler : 4.14.x
13+ dune-cache : true
1314 - name : Install dependencies
1415 run : |
1516 sudo apt-get update
2021 # needs `opam exec --` as `dune` is not in the shell PATH
2122 opam exec -- dune fmt --preview
2223
23- install-ubuntu :
24+ cli-and-doc :
2425 runs-on : ubuntu-22.04
2526 strategy :
2627 fail-fast : false
3839 uses : ocaml/setup-ocaml@v2
3940 with :
4041 ocaml-compiler : ${{ matrix.ocaml-compiler }}
42+ dune-cache : true
4143 - name : Install dependencies
4244 run : |
4345 sudo apt-get update
7274 uses : ocaml/setup-ocaml@v2
7375 with :
7476 ocaml-compiler : 4.13.x
77+ dune-cache : true
7578 - name : Install dependencies
7679 run : |
7780 sudo apt-get update
9194 - name : Nose tests
9295 run : opam exec -- nosetests -v tests/kappy
9396
94- js :
97+ webapp-ubuntu :
9598 runs-on : ubuntu-22.04
9699 steps :
97100 - name : Checkout
@@ -100,15 +103,15 @@ jobs:
100103 uses : ocaml/setup-ocaml@v2
101104 with :
102105 ocaml-compiler : 4.13.x
106+ dune-cache : true
103107 - name : Install system dependencies
104108 run : |
105109 sudo apt-get update
106110 sudo apt-get install --yes gnuplot-nox \
107111 poppler-utils graphviz texlive-latex-recommended \
108112 texlive-fonts-recommended texlive-pictures tex4ht
109113 - name : Install OPAM dependencies
110- run : |
111- opam install --yes . --deps-only
114+ run : opam install --yes . --deps-only
112115 - name : Make Kappa
113116 run : opam exec -- make all
114117 - name : Make Javascript app
@@ -126,7 +129,7 @@ jobs:
126129 viz
127130 Kappapp.tar.gz
128131
129- macos :
132+ webapp- macos :
130133 runs-on : macos-13
131134 steps :
132135 - name : Checkout
@@ -135,9 +138,9 @@ jobs:
135138 uses : ocaml/setup-ocaml@v2
136139 with :
137140 ocaml-compiler : 4.13.x
141+ dune-cache : true
138142 - name : Install OPAM dependencies
139- run : |
140- opam install --yes . --deps-only
143+ run : opam install --yes . --deps-only
141144 - name : Make Kappa
142145 run : opam exec -- make all
143146 - name : Make MacOS app
@@ -154,10 +157,9 @@ jobs:
154157 uses : actions/upload-artifact@v4
155158 with :
156159 name : macos
157- path : |
158- Kappapp.app.zip
160+ path : Kappapp.app.zip
159161
160- windows :
162+ webapp- windows :
161163 runs-on : windows-2022
162164 steps :
163165 - name : Checkout
@@ -166,29 +168,31 @@ jobs:
166168 uses : ocaml/setup-ocaml@v3
167169 with :
168170 ocaml-compiler : 4.14.x
171+ dune-cache : true
169172 - name : Install OPAM dependencies
170- run : |
171- opam install --yes . --deps-only
173+ run : opam install --yes . --deps-only
172174 - name : Make Kappa
173175 run : opam exec -- make all
174176 - name : Make Windows app
175177 run : |
176- opam exec -- make KappaBin
178+ opam exec -- make KappappWin
177179 # Note: This runs powershell thus the different path syntax
178- mv .\build\KappaBin .
180+ mv .\build\KappappWin .
179181 # Note: Windows VMs on GitHub Action do not have zip command but provide 7z
180- 7z a -tzip KappaBin .zip KappaBin
182+ 7z a -tzip KappappWin .zip KappappWin
181183 - name : Archive Windows app
182184 uses : actions/upload-artifact@v4
183185 with :
184186 name : windows
185- path : |
186- KappaBin.zip
187+ path : KappappWin.zip
187188
188- deploy-docs :
189- needs : install-ubuntu
190- runs-on : ubuntu-22.04
189+ deploy :
190+ needs : [cli-and-doc, webapp-ubuntu, webapp-macos, webapp-windows]
191191 if : github.ref == 'refs/heads/master'
192+ runs-on : ubuntu-22.04
193+ strategy :
194+ matrix :
195+ deploy-name : [doc, online-ui, linux, macos, windows]
192196 steps :
193197 - name : Checkout
194198 uses : actions/checkout@v4
@@ -201,58 +205,13 @@ jobs:
201205 with :
202206 key : ${{ secrets.DEPLOY_KEY }}
203207 known_hosts : api.kappalanguage.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJooIEJd6sgRL5JUKGqh9zB3Xla1MchqR8IWl7Nh9ahm9Ji6IwV9QSKG9YQEIHdJWxBk4UzbfRWGkDK9q1GggyM=
204- - run : dev/update-web.sh native
205-
206- deploy-js :
207- needs : js
208- runs-on : ubuntu-22.04
209- if : github.ref == 'refs/heads/master'
210- steps :
211- - name : Checkout
212- uses : actions/checkout@v4
213- - name : Download js artifact
214- uses : actions/download-artifact@v4
215- with :
216- name : js
217- - name : Install SSH Key
218- uses : shimataro/ssh-key-action@v2
219- with :
220- key : ${{ secrets.DEPLOY_KEY }}
221- known_hosts : api.kappalanguage.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJooIEJd6sgRL5JUKGqh9zB3Xla1MchqR8IWl7Nh9ahm9Ji6IwV9QSKG9YQEIHdJWxBk4UzbfRWGkDK9q1GggyM=
222- - run : dev/update-web.sh js
223-
224- deploy-macos :
225- needs : macos
226- runs-on : ubuntu-22.04
227- if : github.ref == 'refs/heads/master'
228- steps :
229- - name : Checkout
230- uses : actions/checkout@v4
231- - name : Download MacOS artifact
232- uses : actions/download-artifact@v4
233- with :
234- name : macos
235- - name : Install SSH Key
236- uses : shimataro/ssh-key-action@v2
237- with :
238- key : ${{ secrets.DEPLOY_KEY }}
239- known_hosts : api.kappalanguage.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJooIEJd6sgRL5JUKGqh9zB3Xla1MchqR8IWl7Nh9ahm9Ji6IwV9QSKG9YQEIHdJWxBk4UzbfRWGkDK9q1GggyM=
240- - run : dev/update-web.sh MacOS
208+ - run : dev/upload-website.sh ${{matrix.deploy-name}}
241209
242- deploy-windows :
243- needs : windows
244- runs-on : ubuntu-22.04
245- if : github.ref == 'refs/heads/master'
246- steps :
247- - name : Checkout
248- uses : actions/checkout@v4
249- - name : Download Windows artifact
250- uses : actions/download-artifact@v4
251- with :
252- name : windows
253- - name : Install SSH Key
254- uses : shimataro/ssh-key-action@v2
255- with :
256- key : ${{ secrets.DEPLOY_KEY }}
257- known_hosts : api.kappalanguage.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJooIEJd6sgRL5JUKGqh9zB3Xla1MchqR8IWl7Nh9ahm9Ji6IwV9QSKG9YQEIHdJWxBk4UzbfRWGkDK9q1GggyM=
258- - run : dev/update-web.sh windows
210+ # TODO: see if add cache
211+ # # from https://github.com/hazelgrove/hazel/blob/868f673119827a35ec67fad5e7e0d5135ce91d4c/.github/workflows/deploy_branches.yml#L19-L29
212+ # - name: Retrieve the switch environment if cached
213+ # id: opam-cache-switch
214+ # uses: actions/cache@v4
215+ # with:
216+ # path: '_opam'
217+ # key: ${{ runner.os }}-opam-${{ env.cache-name }}-${{ matrix.ocaml-compiler }}-${{ matrix.additional-packages}}-${{ hashFiles('*.opam') }}
0 commit comments