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

Add a trunk-build github action #501

Merged
merged 3 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
53 changes: 53 additions & 0 deletions .github/workflows/trunk-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build on `trunk`

on:
push:
NathanReb marked this conversation as resolved.
Show resolved Hide resolved
branches:
- main
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@v4

- 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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Ppxlib - Meta-programming for OCaml

[![ocaml-ci status][ocaml-ci-img]][ocaml-ci] [![AppVeyor status][appveyor-img]][appveyor]
[![ocaml-ci status][ocaml-ci-img]][ocaml-ci] [![trunk-build-status][trunk-build-img]][trunk-build] [![AppVeyor status][appveyor-img]][appveyor]

[ocaml-ci]: https://ci.ocamllabs.io/github/ocaml-ppx/ppxlib
[ocaml-ci-img]: https://img.shields.io/endpoint?url=https%3A%2F%2Fci.ocamllabs.io%2Fbadge%2Focaml-ppx%2Fppxlib%2Fmain&logo=ocaml
[appveyor]: https://ci.appveyor.com/project/diml/ppxlib/branch/main
[appveyor-img]: https://ci.appveyor.com/api/projects/status/bogbsm33uvh083jx?svg=true
[trunk-build]: https://github.com/ocaml-ppx/ppxlib/actions/workflows/trunk-build.yml
[trunk-build-img]: https://github.com/ocaml-ppx/ppxlib/actions/workflows/trunk-build.yml/badge.svg?branch=main

[Ppxlib documentation][doc]

Expand Down
Loading