forked from ocaml-ppx/ppxlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds an action that builds with the latest supported trunk. I heavily reused the work of @shym from ocaml-ppx#410, thank you for this contribution! Signed-off-by: Nathan Rebours <[email protected]>
- Loading branch information
Showing
2 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Build on `trunk` | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
# Every weekday, at 5:43 UTC | ||
- cron: '43 5 * * 1-5' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Pick up a robust cache prefix | ||
id: setup | ||
run: | | ||
# Ensure that cache is flushed when trunk is updated | ||
cache_prefix="$(git ls-remote https://github.com/ocaml/ocaml.git refs/heads/trunk | cut -f 1)" | ||
echo "cache_prefix=$cache_prefix" >> "$GITHUB_OUTPUT" | ||
cat "$GITHUB_OUTPUT" | ||
- name: Install OCaml compiler | ||
uses: ocaml/setup-ocaml@v2 | ||
with: | ||
ocaml-compiler: 'ocaml-variants.5.3.0+trunk' | ||
dune-cache: true | ||
cache-prefix: ${{ steps.setup.outputs.cache_prefix }} | ||
|
||
- name: Install ppxlib dependencies | ||
run: | | ||
opam install ./ppxlib.opam --deps-only | ||
- name: Show configuration | ||
run: | | ||
opam exec -- ocamlc -config | ||
opam config list | ||
opam exec -- dune printenv | ||
opam list | ||
- name: Build the ppxlib | ||
run: opam exec -- dune build -p ppxlib @install | ||
|
||
- name: Install test dependencies | ||
run: | | ||
opam install ./ppxlib.opam --deps-only -t | ||
opam exec -- dune build -p ppxlib @runtest | ||
continue-on-error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters