Skip to content

Commit

Permalink
Merge pull request #501 from NathanReb/trunk-ci
Browse files Browse the repository at this point in the history
Add a trunk-build github action
  • Loading branch information
NathanReb authored Jun 17, 2024
2 parents bfdc4b3 + 2def04d commit 0a842ea
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
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:
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

0 comments on commit 0a842ea

Please sign in to comment.