Skip to content

Commit

Permalink
Merge pull request #50 from UQ-PAC/use-nix
Browse files Browse the repository at this point in the history
ci: use nix
  • Loading branch information
katrinafyi authored Mar 4, 2024
2 parents 064c257 + 7a37101 commit b2ead96
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 31 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/opam.yml
Original file line number Diff line number Diff line change
@@ -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

49 changes: 18 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,25 @@ 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
- uses: actions/checkout@v4

- name: Build
run: |
eval `opam env`
dune build
- uses: cachix/install-nix-action@v25
- run: echo 'preparing nix shell environment'

- name: Test
id: test
run: |
eval `opam env`
export LD_LIBRARY_PATH=`opam config var z3:lib`
./coverage.sh test
- run: dune build --profile release
- run: ./coverage.sh test
id: coverage

- name: Upload new coverage results
if: always()
uses: actions/upload-artifact@v3
with:
name: coverage-output-${{ github.run_id }}
path: ${{ steps.test.outputs.OUTPUT }}
- name: Upload new coverage results
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-output-${{ github.run_id }}
path: ${{ steps.coverage.outputs.OUTPUT }}
1 change: 1 addition & 0 deletions asli.opam
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ depends: [
"dune-site"
"lwt"
"cohttp-lwt-unix"
"yojson"
"odoc" {with-doc}
]
build: [
Expand Down
1 change: 1 addition & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"dune-site"
"lwt"
"cohttp-lwt-unix"
"yojson"
)
(sites (share aslfiles))
)
Expand Down

0 comments on commit b2ead96

Please sign in to comment.