From dfee834611db745d0709c2c55fee99823c9a1632 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Sat, 15 Feb 2025 00:07:48 -0500 Subject: [PATCH] add CI --- .github/workflows/gh-pages.yml | 35 ++++++++++++++++++++ .github/workflows/main.yml | 58 ++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 .github/workflows/gh-pages.yml create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..46a599b --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,35 @@ +name: github pages + +on: + push: + branches: + - main # Set a branch name to trigger deployment + +jobs: + deploy: + name: Deploy doc + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + + - name: Use OCaml + uses: ocaml/setup-ocaml@v3 + with: + ocaml-compiler: '5.2' + dune-cache: true + allow-prerelease-opam: true + + # temporary until it's in a release + - run: opam pin picos 0.6.0 -y -n + + - run: opam install picos moonpool trace + + - run: opam exec -- odig odoc --cache-dir=_doc/ nanoev + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_doc/html + destination_dir: . + enable_jekyll: false diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..0eff5fb --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,58 @@ +name: Build and Test + +on: + push: + branches: + - main + pull_request: + +jobs: + run: + name: build # build+test on various versions of OCaml, on linux + timeout-minutes: 15 + strategy: + fail-fast: true + matrix: + os: + - ubuntu-latest + ocaml-compiler: + - '5.0' + - '5.3' + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@main + - name: Use OCaml ${{ matrix.ocaml-compiler }} + uses: ocaml/setup-ocaml@v3 + with: + ocaml-compiler: ${{ matrix.ocaml-compiler }} + dune-cache: true + allow-prerelease-opam: true + + - run: opam exec -- dune build @install + + # install some depopts + - run: opam pin picos 0.6.0 -y -n + - run: opam install -t moonpool trace picos + + - run: opam exec -- dune build --profile=release --force @install @runtest + + format: + name: format + strategy: + matrix: + ocaml-compiler: + - '5.2' + runs-on: 'ubuntu-latest' + steps: + - uses: actions/checkout@main + - name: Use OCaml ${{ matrix.ocaml-compiler }} + uses: ocaml/setup-ocaml@v3 + with: + ocaml-compiler: ${{ matrix.ocaml-compiler }} + dune-cache: true + allow-prerelease-opam: true + + - run: opam install ocamlformat.0.26.2 + - run: opam exec -- make format-check +