From bf7f62f81b51039d8b89885bf1ea2f81e69bdd43 Mon Sep 17 00:00:00 2001 From: TDacik Date: Mon, 20 Jan 2025 15:33:33 +0100 Subject: [PATCH] Fix workflows --- .github/workflows/setup.yml | 26 ++++++++++++++++++++++++++ .github/workflows/tests.yml | 31 +++++++------------------------ 2 files changed, 33 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/setup.yml diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml new file mode 100644 index 0000000..bcb0c5e --- /dev/null +++ b/.github/workflows/setup.yml @@ -0,0 +1,26 @@ +# Reusable workflow to setup and build Astral +# +# Author: Tomas Dacik (idacik@fit.vut.cz), 2025 + +on: + workflow_call: + inputs: [] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set-up OCaml + uses: ocaml/setup-ocaml@v2 + with: + ocaml-compiler: 4.2 + dunecache: true + + - name: Install dependencies + run: opam install -y --deps-only --with-test --with-doc . + + - name: Install Astral + run: opam exec -- dune build diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 02f7769..f9c664f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,39 +8,22 @@ on: [push, pull_request] jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set-up OCaml - uses: ocaml/setup-ocaml@v3 - with: - ocaml-compiler: 5.2 - - - name: Install dependencies - run: opam install -y --deps-only --with-test --with-doc . - - - name: Install Astral - run: opam exec -- dune build - unit-tests: - needs: build + uses: .github/workflows/setup.yml runs-on: ubuntu-latest - steps: + steps: - name: Run unit tests run: opam exec -- dune runtest regression-tests: - needs: build + uses: .github/workflows/setup.yml runs-on: ubuntu-latest - steps: + steps: - name: Run regression tests run: python3 scripts/run_tests.py - + deploy-doc: - needs: build + uses: .github/workflows/setup.yml runs-on: ubuntu-latest environment: @@ -52,7 +35,7 @@ jobs: id-token: write pages: write - steps: + steps: - name: Build documentation run: opam exec -- dune build @doc