Skip to content

Commit

Permalink
Some more CI tests (#127)
Browse files Browse the repository at this point in the history
* Run tests on all versions of ocaml + some more install tests

* Try and fix versions for ocaml

* try and fix build file

* Fix ci script for windows versions

* Stop enforcing exit codes for better logging upon errors

* Fix versions for windows

* Try and fix matrix for install job

* Mainly test through opam installation

* more robust install script

* Rename test -> build
  • Loading branch information
Gbury authored Feb 10, 2023
1 parent ccf86bb commit f77c4a6
Show file tree
Hide file tree
Showing 85 changed files with 1,389 additions and 1,437 deletions.
29 changes: 19 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,9 @@ jobs:
os:
- ubuntu-latest

# Ocaml versions to test. This is a bit of a misnomer, considering
# that it is actually just a list of package to install as the base
# of the switch
# Ocaml versions to use
ocaml-version:
- ocaml-base-compiler.5.0.0
- ocaml-variants.4.14.0+options,ocaml-option-flambda
- ocaml-base-compiler.4.14.0
- ocaml-base-compiler.4.13.1
- ocaml-base-compiler.4.12.1
- ocaml-base-compiler.4.11.2
- ocaml-base-compiler.4.10.1

# Build ENV
# ---------
Expand All @@ -69,7 +61,24 @@ jobs:
run: opam update
# Install ocaml deps
- name: Install Ocaml deps
run: opam install . --deps-only
run: opam install . --deps-only --with-test --with-doc
# Build the package
- name: Build the package
run: opam exec -- make
# Check the tests
- name: Build the examples
run: opam exec -- make test
# Check the doc builds
- name: Build the doc
run: opam exec -- make doc

# Update the doc
# --------------
- name: Deploy the dev documentation
uses: JamesIves/[email protected]
if: github.ref == 'refs/heads/master'
with:
branch: gh-pages
folder: _build/default/_doc/_html
target-folder: dev

62 changes: 45 additions & 17 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,38 +32,63 @@ jobs:
fail-fast: false

matrix:
# Operating system to run tests on.
os:
- ubuntu-latest
- macos-latest
- windows-latest

# Dolmen package to test installation of
dolmen-pkg:
- dolmen_bin
- dolmen_lsp

# Ocaml versions to use
# Also test flambda to make sure the installation time is reasonable
# Note that because on windows, switches have different names, we
# must do a bit of work manually to get a correct ocaml-version
include:
- ocaml-version: 4.14.0
# linux
- ocaml-version: ocaml-base-compiler.4.10.1
os: ubuntu-latest
- ocaml-version: ocaml-base-compiler.4.11.2
os: ubuntu-latest
- ocaml-version: ocaml-base-compiler.4.12.1
os: ubuntu-latest
- ocaml-version: ocaml-base-compiler.4.13.1
os: ubuntu-latest
- ocaml-version: ocaml-base-compiler.4.14.0
os: ubuntu-latest
- ocaml-version: ocaml-variants.4.14.0+options,ocaml-option-flambda
os: ubuntu-latest
- ocaml-version: ocaml-base-compiler.5.0.0
os: ubuntu-latest

# macos
- ocaml-version: ocaml-base-compiler.4.10.1
os: macos-latest
- ocaml-version: ocaml-base-compiler.4.11.2
os: macos-latest
- ocaml-version: ocaml-base-compiler.4.12.1
os: macos-latest
- ocaml-version: ocaml-base-compiler.4.13.1
os: macos-latest
- ocaml-version: ocaml-base-compiler.4.14.0
os: macos-latest
- ocaml-version: ocaml-variants.4.14.0+options,ocaml-option-flambda
os: macos-latest
- ocaml-version: ocaml-base-compiler.5.0.0
os: macos-latest

# Windows
- ocaml-version: ocaml-variants.4.10.1+mingw64c
os: windows-latest
- ocaml-version: ocaml-variants.4.11.2+mingw64c
os: windows-latest
- ocaml-version: ocaml-variants.4.12.1+mingw64c
os: windows-latest
- ocaml-version: ocaml-variants.4.13.1+mingw64c
os: windows-latest
- ocaml-version: ocaml-variants.4.14.0+mingw64c
os: windows-latest
- ocaml-version: ocaml-variants.4.14.0+flambda+mingw64c
os: windows-latest


# Build ENV
# ---------
env:
# Ensure opam will not stop because it waits on some user input
OPAMYES: "true"


# Build/test steps
# ----------------
steps:
Expand All @@ -82,9 +107,12 @@ jobs:
# Run opam udpate to get an up-to-date repo
- name: Update opam repo
run: opam update
# Install the package
- name: Install package
run: opam install --with-test ${{ matrix.dolmen-pkg }}
# Install dependencies
- name: Install dependencies
run: opam install . --deps-only --with-test --with-doc
# Install each package
- name: Install dolmen
run: opam install . --with-test --with-doc
timeout-minutes: 20
# Ensure that installation does not take too long
# (particularly with regards to flambda)
Expand Down
85 changes: 0 additions & 85 deletions .github/workflows/test.yml

This file was deleted.

8 changes: 4 additions & 4 deletions tests/headers/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(package dolmen_bin)
(action (chdir %{workspace_root}
(with-outputs-to %{target}
(with-accepted-exit-codes (not 0)
(with-accepted-exit-codes (or 0 (not 0))
(run dolmen --mode=incremental --color=never %{input} %{read-lines:flags.dune}))))))
(rule
(alias runtest)
Expand All @@ -25,7 +25,7 @@
(package dolmen_bin)
(action (chdir %{workspace_root}
(with-outputs-to %{target}
(with-accepted-exit-codes (not 0)
(with-accepted-exit-codes (or 0 (not 0))
(run dolmen --mode=full --color=never %{input} %{read-lines:flags.dune}))))))
(rule
(alias runtest)
Expand All @@ -42,7 +42,7 @@
(package dolmen_bin)
(action (chdir %{workspace_root}
(with-outputs-to %{target}
(with-accepted-exit-codes 0
(with-accepted-exit-codes (or 0 (not 0))
(run dolmen --mode=incremental --color=never %{input} %{read-lines:flags.dune}))))))
(rule
(alias runtest)
Expand All @@ -57,7 +57,7 @@
(package dolmen_bin)
(action (chdir %{workspace_root}
(with-outputs-to %{target}
(with-accepted-exit-codes 0
(with-accepted-exit-codes (or 0 (not 0))
(run dolmen --mode=full --color=never %{input} %{read-lines:flags.dune}))))))
(rule
(alias runtest)
Expand Down
8 changes: 4 additions & 4 deletions tests/model/adt/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(package dolmen_bin)
(action (chdir %{workspace_root}
(with-outputs-to %{target}
(with-accepted-exit-codes 0
(with-accepted-exit-codes (or 0 (not 0))
(run dolmen --check-model=true -r %{response} --mode=incremental --color=never %{input} %{read-lines:flags.dune}))))))
(rule
(alias runtest)
Expand All @@ -25,7 +25,7 @@
(package dolmen_bin)
(action (chdir %{workspace_root}
(with-outputs-to %{target}
(with-accepted-exit-codes 0
(with-accepted-exit-codes (or 0 (not 0))
(run dolmen --check-model=true -r %{response} --mode=full --color=never %{input} %{read-lines:flags.dune}))))))
(rule
(alias runtest)
Expand All @@ -42,7 +42,7 @@
(package dolmen_bin)
(action (chdir %{workspace_root}
(with-outputs-to %{target}
(with-accepted-exit-codes 0
(with-accepted-exit-codes (or 0 (not 0))
(run dolmen --check-model=true -r %{response} --mode=incremental --color=never %{input} %{read-lines:flags.dune}))))))
(rule
(alias runtest)
Expand All @@ -57,7 +57,7 @@
(package dolmen_bin)
(action (chdir %{workspace_root}
(with-outputs-to %{target}
(with-accepted-exit-codes 0
(with-accepted-exit-codes (or 0 (not 0))
(run dolmen --check-model=true -r %{response} --mode=full --color=never %{input} %{read-lines:flags.dune}))))))
(rule
(alias runtest)
Expand Down
8 changes: 4 additions & 4 deletions tests/model/bitv/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(package dolmen_bin)
(action (chdir %{workspace_root}
(with-outputs-to %{target}
(with-accepted-exit-codes 0
(with-accepted-exit-codes (or 0 (not 0))
(run dolmen --check-model=true -r %{response} --mode=incremental --color=never %{input} %{read-lines:flags.dune}))))))
(rule
(alias runtest)
Expand All @@ -25,7 +25,7 @@
(package dolmen_bin)
(action (chdir %{workspace_root}
(with-outputs-to %{target}
(with-accepted-exit-codes 0
(with-accepted-exit-codes (or 0 (not 0))
(run dolmen --check-model=true -r %{response} --mode=full --color=never %{input} %{read-lines:flags.dune}))))))
(rule
(alias runtest)
Expand All @@ -42,7 +42,7 @@
(package dolmen_bin)
(action (chdir %{workspace_root}
(with-outputs-to %{target}
(with-accepted-exit-codes 0
(with-accepted-exit-codes (or 0 (not 0))
(run dolmen --check-model=true -r %{response} --mode=incremental --color=never %{input} %{read-lines:flags.dune}))))))
(rule
(alias runtest)
Expand All @@ -57,7 +57,7 @@
(package dolmen_bin)
(action (chdir %{workspace_root}
(with-outputs-to %{target}
(with-accepted-exit-codes 0
(with-accepted-exit-codes (or 0 (not 0))
(run dolmen --check-model=true -r %{response} --mode=full --color=never %{input} %{read-lines:flags.dune}))))))
(rule
(alias runtest)
Expand Down
Loading

0 comments on commit f77c4a6

Please sign in to comment.