From 890c758fd8fd6622f2eb93d7894cf41599523eeb Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 5 Mar 2025 18:07:44 +0800 Subject: [PATCH] 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 --- .github/workflows/samples-ocaml.yaml | 34 +++++++++++++++++++ .../petstore/ocaml/.openapi-generator-ignore | 1 + 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/samples-ocaml.yaml diff --git a/.github/workflows/samples-ocaml.yaml b/.github/workflows/samples-ocaml.yaml new file mode 100644 index 00000000000..1f03811073a --- /dev/null +++ b/.github/workflows/samples-ocaml.yaml @@ -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 }} diff --git a/samples/client/petstore/ocaml/.openapi-generator-ignore b/samples/client/petstore/ocaml/.openapi-generator-ignore index 7484ee590a3..daed634bb4b 100644 --- a/samples/client/petstore/ocaml/.openapi-generator-ignore +++ b/samples/client/petstore/ocaml/.openapi-generator-ignore @@ -21,3 +21,4 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md +#