Add github workflow for OCaml samples (#20802)

* add github workflow for ocaml sample

* trigger build

* test with 5

* install dune

* install yojson

* install others

* install

* add name

* trigger build failure

* Revert "trigger build failure"

This reverts commit be35b26a83a1c961315d53b474658fbd5ff5fa62.

* test with 5

* pin versions
This commit is contained in:
William Cheng 2025-03-05 18:07:44 +08:00 committed by GitHub
parent f2bbb9e0a2
commit 890c758fd8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 35 additions and 0 deletions

34
.github/workflows/samples-ocaml.yaml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Samples OCaml
on:
push:
paths:
- 'samples/client/petstore/ocaml/**'
pull_request:
paths:
- 'samples/client/petstore/ocaml/**'
jobs:
build:
name: Build OCaml
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
- 'samples/client/petstore/ocaml/'
steps:
- uses: actions/checkout@v4
- name: Set-up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 5
- name: Install
run: opam install . --deps-only --with-test
working-directory: ${{ matrix.sample }}
- name: Install Misc
run: opam install dune ppx_deriving_yojson conf-libev lwt cohttp-lwt-unix.5.3.0 cohttp-async.5.3.0
working-directory: ${{ matrix.sample }}
- name: Build
run: opam exec -- dune build
working-directory: ${{ matrix.sample }}

View File

@ -21,3 +21,4 @@
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
#