From 1da20e27a74fe7d71b1d536ab2e1d774299bae5c Mon Sep 17 00:00:00 2001 From: rina Date: Mon, 4 Mar 2024 00:50:35 +1000 Subject: [PATCH 1/3] ci: use nix Update test.yml Update test.yml Update test.yml Update test.yml Update test.yml Update test.yml Update test.yml Update test.yml Update test.yml boopfdsa no opam asd add bash arguments. update workflow --- .github/workflows/test.yml | 61 +++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d257ce37..3b7ad6c7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,38 +15,31 @@ permissions: jobs: test: runs-on: ubuntu-latest - container: - image: ghcr.io/uq-pac/asli-base:latest - credentials: - username: ${{ github.actor }} - password: ${{ secrets.github_token }} + defaults: + run: + # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell + # XXX using multi-line string will fail since \n is stuck to the end of the argument. + shell: "nix develop github:katrinafyi/pac-nix#ocamlPackages_pac.asli --impure --accept-flake-config --command bash --noprofile --norc -eo pipefail {0}" + steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Extract encodings - run: tar xzf encodings.tar.gz - - - name: opam install - run: | - eval `opam env` - opam install . --deps-only --with-test - - - name: Build - run: | - eval `opam env` - dune build - - - name: Test - id: test - run: | - eval `opam env` - export LD_LIBRARY_PATH=`opam config var z3:lib` - ./coverage.sh test - - - name: Upload new coverage results - if: always() - uses: actions/upload-artifact@v3 - with: - name: coverage-output-${{ github.run_id }} - path: ${{ steps.test.outputs.OUTPUT }} + - uses: actions/checkout@v4 + + - uses: cachix/install-nix-action@v25 + - run: echo 'preparing nix shell environment' + + # it will be nice to make this work, just in case we aslp adds new dependencies + # - uses: ocaml/setup-ocaml@v2 + # with: + # ocaml-compiler: ocaml-system.4.09.1 # must match nix develop's ocaml version! + # - run: opam install . --deps-only --with-test + + - run: dune build --profile release + - run: ./coverage.sh test + id: coverage + + - name: Upload new coverage results + if: always() + uses: actions/upload-artifact@v4 + with: + name: coverage-output-${{ github.run_id }} + path: ${{ steps.coverage.outputs.OUTPUT }} From c82ff0146ef96526f0c362c7a2c7cf20b28e5d16 Mon Sep 17 00:00:00 2001 From: rina Date: Mon, 4 Mar 2024 02:06:58 +1000 Subject: [PATCH 2/3] ci: add vanilla opam build. touch touch remove pr trigger run on github changes Update opam.yml Update opam.yml opam exec dune --- .github/workflows/opam.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/test.yml | 6 ------ 2 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/opam.yml diff --git a/.github/workflows/opam.yml b/.github/workflows/opam.yml new file mode 100644 index 00000000..e7df55b3 --- /dev/null +++ b/.github/workflows/opam.yml @@ -0,0 +1,28 @@ +name: Build with opam + +on: + push: + branches: [ partial_eval ] + paths: [ '*.opam', '.github/**' ] + pull_request: + paths: [ '*.opam', '.github/**' ] + workflow_dispatch: + +# only run one instance of this action at a time. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ocaml/setup-ocaml@v2 + with: + ocaml-compiler: 4.09 + - run: opam install dune + - run: opam install . --deps-only --with-test + - run: opam exec -- dune build --profile release + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3b7ad6c7..ba2249b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,12 +27,6 @@ jobs: - uses: cachix/install-nix-action@v25 - run: echo 'preparing nix shell environment' - # it will be nice to make this work, just in case we aslp adds new dependencies - # - uses: ocaml/setup-ocaml@v2 - # with: - # ocaml-compiler: ocaml-system.4.09.1 # must match nix develop's ocaml version! - # - run: opam install . --deps-only --with-test - - run: dune build --profile release - run: ./coverage.sh test id: coverage From 7a37101c8fa89cca34eb342b4cfc494867a0fc7b Mon Sep 17 00:00:00 2001 From: rina Date: Mon, 4 Mar 2024 13:18:52 +1000 Subject: [PATCH 3/3] dune: add yojson dependency --- asli.opam | 1 + dune-project | 1 + 2 files changed, 2 insertions(+) diff --git a/asli.opam b/asli.opam index f79b928e..c458f186 100644 --- a/asli.opam +++ b/asli.opam @@ -29,6 +29,7 @@ depends: [ "dune-site" "lwt" "cohttp-lwt-unix" + "yojson" "odoc" {with-doc} ] build: [ diff --git a/dune-project b/dune-project index 5a0a3520..a8ec66bf 100644 --- a/dune-project +++ b/dune-project @@ -28,6 +28,7 @@ "dune-site" "lwt" "cohttp-lwt-unix" + "yojson" ) (sites (share aslfiles)) )