From 9a197c137f3ab84468bc548f5734ebab365d5820 Mon Sep 17 00:00:00 2001 From: "Haochen M. Kotoi-Xie" Date: Fri, 27 Sep 2024 13:54:49 +0900 Subject: [PATCH] mirror arck/camlsrc/kxclib/.github/workflows/common.yml in rinm/ --- .github/workflows/common.yml | 66 ++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/common.yml diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml new file mode 100644 index 0000000..071dd1f --- /dev/null +++ b/.github/workflows/common.yml @@ -0,0 +1,66 @@ +name: Common CI workflow + +on: + push: + branches: [main] + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + ocaml-version: + - 5.1.x + node-version: + - lts/hydrogen # v18 Active LTS + oven-version: + - latest + - 1.0.25 + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 2 + + - name: Use OCaml ${{ matrix.ocaml-version }} + uses: ocaml/setup-ocaml@v2 + with: + ocaml-compiler: ${{ matrix.ocaml-version }} + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: yarn + cache-dependency-path: 'melange/yarn.lock' + + - uses: oven-sh/setup-bun@v1 + with: + bun-version: ${{ matrix.oven-version }} + + - name: Cache OPAM switch + id: cache-switch + uses: actions/cache@v3 + with: + path: _opam + key: v1-${{ runner.os }}-${{ matrix.ocaml-version }}-${{ hashFiles('**.opam') }}-opam-switch + + - name: Install dependencies + run: opam install . --deps-only --with-test --with-doc + + - name: build + run: opam exec -- dune build + + - name: doc + run: opam exec -- dune build @doc + + - name: test + run: opam exec -- dune runtest