Add first attempt at dirichlet #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Test code blocks" | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install poetry | |
poetry install | |
- name: Run code extraction | |
run: | | |
poetry run pytest tests/extract.py | |
- name: Install C++ deps | |
run: | | |
sudo apt install libboost-math-dev | |
- name: Install Python deps | |
run: | | |
pip install --upgrade pip wheel | |
pip install numpy scipy | |
- name: Check params | |
run: | | |
cat normal/params.json | |
working-directory: tests/test_output | |
- name: Compile and run C++ files | |
run: | | |
g++ -o pdf pdf.cpp | |
g++ -o logpdf logpdf.cpp | |
g++ -o rvs rvs.cpp | |
./pdf > pdf.out | |
./logpdf > logpdf.out | |
./rvs > rvs.out | |
working-directory: tests/test_output/normal/cpp | |
- name: Run Python files | |
run: | | |
python pdf.py > pdf.out | |
python logpdf.py > logpdf.out | |
python rvs.py > rvs.out | |
working-directory: tests/test_output/normal/python | |
- name: Run code validation | |
run: | | |
poetry run pytest tests/validate_code_output.py |