Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use setup-ocaml github action #1341

Merged
merged 50 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e30a41e
Add new build using setup ocaml action
7h3kk1d Jul 25, 2024
57feaa0
Start switching to dune for dependency management
7h3kk1d Jul 25, 2024
8b064b1
Update lock file
7h3kk1d Jul 25, 2024
90817f0
Fix ocaml compiler in build
7h3kk1d Jul 25, 2024
8426564
Fix omd version
7h3kk1d Jul 25, 2024
fe0f52a
Switch install dependencies method
7h3kk1d Jul 25, 2024
c4e8f7f
Try adding hyphens
7h3kk1d Jul 25, 2024
4fe8109
Move to old build
7h3kk1d Jul 25, 2024
ded78f4
Reremove test step
7h3kk1d Jul 26, 2024
6de922f
Cache build environment
7h3kk1d Jul 26, 2024
8749d01
Update makefile change-deps
7h3kk1d Jul 26, 2024
c783f76
Try enabling dune cache
7h3kk1d Jul 26, 2024
dd7408f
Fix makefile
7h3kk1d Jul 26, 2024
76649e9
setup-ocaml already caches .opam
7h3kk1d Jul 26, 2024
ff28e1e
Update makefile again
7h3kk1d Jul 26, 2024
7dfcbd5
enable dune cache
7h3kk1d Jul 26, 2024
50c833a
Set locked flag
7h3kk1d Jul 26, 2024
0d943de
Use dune cache for build
7h3kk1d Jul 26, 2024
9837c39
Add ssh debug step to see .opam
7h3kk1d Jul 26, 2024
362e73d
Cache after setup ocaml
7h3kk1d Jul 26, 2024
ca6ce7a
trigger build
7h3kk1d Jul 26, 2024
b483279
Debug again
7h3kk1d Jul 26, 2024
4a88eba
Upgrade actions cache
7h3kk1d Jul 26, 2024
c5578cb
Add opam switch cache step
7h3kk1d Jul 26, 2024
ee3dc23
Redisable debug
7h3kk1d Jul 26, 2024
c302b96
Try removing the .opam caching
7h3kk1d Jul 26, 2024
8b9912b
Clean the opam switch
7h3kk1d Jul 26, 2024
868f673
Remove accidental code
7h3kk1d Jul 26, 2024
a270490
Remove opam.export
7h3kk1d Jul 26, 2024
6fe07c6
Stop pinning version numbers in dune-project and update autors/descri…
7h3kk1d Jul 26, 2024
9c8f4bf
Revert whitespace changes
7h3kk1d Jul 26, 2024
8ca2dba
Add comment for opam 2.2 upgrade
7h3kk1d Jul 30, 2024
54418dd
Add ocaml-lsp-server to dependencies
7h3kk1d Jul 30, 2024
5f22eb2
Add documentation for modifying dependencies
7h3kk1d Jul 30, 2024
5a67dc9
Have make change-deps do the full cycle of updating the opam files
7h3kk1d Jul 30, 2024
ac0536f
Tabs in makefiles
7h3kk1d Jul 30, 2024
f66aef3
Formatting update
7h3kk1d Jul 30, 2024
da5aff8
Merge branch 'dev' into setup-ocaml-action
7h3kk1d Aug 2, 2024
3f1842d
Update dependencies in lock file
7h3kk1d Aug 6, 2024
6df5431
Merge remote-tracking branch 'origin/dev' into setup-ocaml-action
7h3kk1d Aug 8, 2024
72d8ae3
Remove arch from opam.locked file for arm osx
7h3kk1d Aug 9, 2024
3cac69f
Merge branch 'dev' into setup-ocaml-action
cyrus- Aug 9, 2024
5cc383d
Merge branch 'dev' into setup-ocaml-action
7h3kk1d Aug 10, 2024
da04f7b
Add with-doc to makefile config to install doc dependencies
7h3kk1d Aug 16, 2024
0f90f65
Add back menhir version
7h3kk1d Aug 16, 2024
b4f22e9
Fix bad commit
7h3kk1d Aug 16, 2024
5a4bea4
Merge remote-tracking branch 'origin/dev' into setup-ocaml-action
7h3kk1d Aug 16, 2024
691a89d
Add hazel.opam.locked to linguist-generated
7h3kk1d Aug 16, 2024
4b3d9fb
Add hazel.opam to generated files given dune-project generates it
7h3kk1d Aug 16, 2024
8ca1c2c
Merge remote-tracking branch 'origin/dev' into setup-ocaml-action
7h3kk1d Aug 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
# decides that the content is text, its line endings are converted to LF on
# checkin. When the file has been committed with CRLF, no conversion is done.
* text=auto

hazel.opam linguist-generated
hazel.opam.locked linguist-generated
32 changes: 19 additions & 13 deletions .github/workflows/deploy_branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,33 @@ jobs:
path: source
- name: Add the name of the current branch to the environment as BRANCH_NAME
uses: nelonoel/branch-name@v1.0.1
- name: Retrieve the build environment if cached
id: opam-cache
uses: actions/cache@v2
with:
path: '/home/runner/.opam/'
key: ${{ runner.os }}-modules-${{ hashFiles('./source/opam.export') }}
- name: Set-up OCaml
run: |
sudo apt --assume-yes install curl m4 opam
export OPAMYES=1
opam init --compiler=ocaml-base-compiler.5.2.0
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 5.2.0
dune-cache: true
- name: Retrieve the switch environment if cached
id: opam-cache-switch
uses: actions/cache@v4
with:
path: '_opam'
key: ${{ runner.os }}-modules-${{ hashFiles('./source/hazel.opam.locked') }}
- name: Install dependencies
run: |
eval $(opam env)
export OPAMYES=1
make deps
export DUNE_CACHE=enabled
opam install . --deps-only --with-test --locked
working-directory: ./source
- name: Build Release
- name: Clean opam switch
run: |
eval $(opam env)
make release
export OPAMYES=1
opam clean --all-switches --download-cache --logs --repo-cache --unused-repositories
- name: Build Release
run: |
export DUNE_CACHE=enabled
opam exec -- dune build @src/fmt --auto-promote src --profile release
working-directory: ./source
- name: Checkout the website build artifacts repo
uses: actions/checkout@v2
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ setup.log

# unit tests
*.xml

# Backup of opam lock file
hazel.opam.locked.old
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ all: dev

deps:
opam update
opam switch import opam.export
opam install ./hazel.opam.locked --deps-only --with-test --with-doc

change-deps:
opam switch export opam.export
sed -i '' '/host-/d' opam.export # remove host- lines which are arch-specific
opam update
dune build hazel.opam
opam install ./hazel.opam --deps-only --with-test --with-doc
cyrus- marked this conversation as resolved.
Show resolved Hide resolved
opam lock .
sed -i'.old' '/host-/d' hazel.opam.locked # remove host- lines which are arch-specific. Not using -i '' because of portability issues https://stackoverflow.com/questions/4247068/sed-command-with-i-option-failing-on-mac-but-works-on-linux

setup-instructor:
cp src/haz3lweb/ExerciseSettings_instructor.re src/haz3lweb/ExerciseSettings.re
Expand Down
12 changes: 12 additions & 0 deletions docs/Change-OCaml-Dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Instructions for Changing Ocaml Dependencies

## How to update dependencies

- Update the dune-project file to reflect the new dependency constraints
- `make change-deps`
- This should generate the hazel.opam file from dune.
- Depending on your installed dependencies you may need to make a new clean switch
- Interrogate the `hazel.opam.locked` file to see what dependencies have changed
- `make release`
- Test in Firefox and Chrome.
- Commit changed files and push
42 changes: 42 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -1,2 +1,44 @@
(lang dune 3.16)
(using menhir 2.0)

(name hazel)

(generate_opam_files true)

(source
(github hazelgrove/hazel))

(authors "Hazel Development Team")
(maintainers "Hazel Development Team")

(license MIT)

(package
(name hazel)
(allow_empty)
(synopsis "Hazel, a live functional programming environment with typed holes")
; (description "A longer description")
; (tags
; (topics "to describe" your project))
(depends
(ocaml
(>= 5.2.0))
(menhir
(>= 2.0))
yojson
reason
ppx_yojson_conv_lib
ppx_yojson_conv
incr_dom
(omd (>= 2.0.0~alpha4))
ezjs_idb
virtual_dom
ppx_deriving
ptmap
uuidm
unionFind
ocamlformat
(junit_alcotest :with-test)
ocaml-lsp-server)) ; After upgrading to opam 2.2 use with-dev https://opam.ocaml.org/blog/opam-2-2-0/
cyrus- marked this conversation as resolved.
Show resolved Hide resolved

; See the complete stanza docs at https://dune.readthedocs.io/en/stable/reference/dune-project/index.html
44 changes: 44 additions & 0 deletions hazel.opam

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

201 changes: 201 additions & 0 deletions hazel.opam.locked

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading