From d393807aba30a918a1b99db8bfd3a54cf464662b Mon Sep 17 00:00:00 2001 From: Matt Bray Date: Sun, 28 Apr 2024 19:47:33 +0100 Subject: [PATCH 1/2] feat(gha): build --- .github/workflows/main.yaml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/main.yaml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..31651cf --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,32 @@ +name: "main" + +on: + workflow_dispatch: + pull_request: + push: + +permissions: + id-token: write + contents: read + statuses: write + +jobs: + build: + strategy: + matrix: + os: + - ubuntu-latest + ocaml-compiler: + - "5.1" + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up OCaml ${{ matrix.ocaml-compiler }} + uses: ocaml/setup-ocaml@v2 + with: + ocaml-compiler: ${{ matrix.ocaml-compiler }} + - run: opam install . --deps-only --with-test + - run: opam exec -- dune build + - run: opam install ocamlformat=0.22.4 + - run: opam exec -- dune build @fmt From 691b949b52c459111c7e9789c6ac744aafd369d0 Mon Sep 17 00:00:00 2001 From: Matt Bray Date: Sun, 28 Apr 2024 21:51:32 +0100 Subject: [PATCH 2/2] feat(gha): format --- .github/workflows/main.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 31651cf..1ec348e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -28,5 +28,11 @@ jobs: ocaml-compiler: ${{ matrix.ocaml-compiler }} - run: opam install . --deps-only --with-test - run: opam exec -- dune build - - run: opam install ocamlformat=0.22.4 - - run: opam exec -- dune build @fmt + + format: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v26 + - run: nix-shell -I nixpkgs=channel:nixos-23.05 --pure -p ocamlformat_0_22_4 dune_3 ocaml --run "dune build @fmt"