Skip to content

Dynamic environment with probabilistic termination implemented in Rust #649

Dynamic environment with probabilistic termination implemented in Rust

Dynamic environment with probabilistic termination implemented in Rust #649

Workflow file for this run

name: test
on:
push:
branches:
- master
pull_request:
jobs:
ocaml:
name: Test OCaml
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- macos-12
ocaml-compiler:
- 4.12.1
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # get complete history, including tags for CPR_VERSION env
- name: Setup OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ocaml-variants.${{ matrix.ocaml-compiler }}+options,ocaml-option-flambda
- name: Install dependencies
run: opam install . --deps-only --with-test
- name: Build and run tests
run: |
export CPR_VERSION=github-${{ matrix.os }}-$(git describe --tags --dirty || git describe --all --long --dirty)
opam exec -- dune build @fmt
opam exec -- dune build
opam exec -- dune runtest
- name: Build engine DLL
run: |
opam exec -- dune build --release simulator/gym/cpr_gym_engine.so &&
cp _build/default/simulator/gym/cpr_gym_engine.so ./
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: cpr_gym_engine-${{ matrix.os }}-ocaml-${{ matrix.ocaml-compiler }}
path: cpr_gym_engine.so
python:
name: Test Python
needs: ocaml
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
python-version:
- 3.9
steps:
- uses: actions/checkout@v3
- name: Download engine DLL
uses: actions/download-artifact@v3
with:
name: cpr_gym_engine-ubuntu-20.04-ocaml-4.12.1
path: ./
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install 'wheel<0.39' 'setuptools<67'
pip install -r requirements.txt
- name: Run tests
run: |
black --check .
flake8
pytest --forked