Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use nix #50

Merged
merged 3 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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