Skip to content

Add github actions workflow for tests #4017

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

Closed
wants to merge 8 commits into from
Closed
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
185 changes: 185 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
name: pymc3

on: [push, pull_request]

jobs:
test-on-linux:
runs-on: ${{ matrix.operating-system }}
strategy:
max-parallel: 16
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
python-version: [3.7]
floatx: ["float32", "float64"]
test-subset:
- '
--ignore=pymc3/tests/test_examples.py
--ignore=pymc3/tests/test_distributions_random.py
--ignore=pymc3/tests/test_variational_inference.py
--ignore=pymc3/tests/test_shared.py
--ignore=pymc3/tests/test_smc.py
--ignore=pymc3/tests/test_updates.py
--ignore=pymc3/tests/test_posteriors.py
--ignore=pymc3/tests/test_sampling.py
--ignore=pymc3/tests/test_parallel_sampling.py
--ignore=pymc3/tests/test_dist_math.py
--ignore=pymc3/tests/test_distribution_defaults.py
--ignore=pymc3/tests/test_distributions_timeseries.py
--ignore=pymc3/tests/test_random.py
--ignore=pymc3/tests/test_gp.py
--ignore=pymc3/tests/test_shape_handling
--ignore=pymc3/tests/test_quadpotential.py
'
- '
pymc3/tests/test_distributions_random.py
pymc3/tests/test_shared.py
pymc3/tests/test_smc.py
pymc3/tests/test_sampling.py
pymc3/tests/test_parallel_sampling.py
pymc3/tests/test_dist_math.py
pymc3/tests/test_distribution_defaults.py
pymc3/tests/test_distributions_timeseries.py
pymc3/tests/test_random.py
'
- '
pymc3/tests/test_examples.py
pymc3/tests/test_posteriors.py
pymc3/tests/test_gp.py
pymc3/tests/test_quadpotential.py
'
- '
pymc3/tests/test_variational_inference.py
pymc3/tests/test_updates.py
pymc3/tests/test_shape_handling.py
'
env:
TEST_SUBSET: ${{ matrix.test-subset }}
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc.cxxflags='-march=native'
steps:
- uses: actions/checkout@v2
- name: Cache conda and theano
uses: actions/cache@v2
env:
# Increase this value to reset cache
CACHE_NUMBER: 0
with:
path: |
~/conda_pkgs_dir
~/.theano
key: ${{ runner.os }}-${{ matrix.floatx }}-py${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}
- name: Install miniconda
uses: goanpeca/setup-miniconda@v1
with:
auto-update-conda: true
activate-environment: pymc3-dev
python-version: ${{ matrix.python-version }}
channels: conda-forge,defaults
channel-priority: strict
- name: Install Dependences
shell: bash -l {0}
run: |
conda install --yes --only-deps pymc3
conda install coverage pytest parameterized dill nose nose-parameterized python-graphviz pytest-cov
- name: Log conda
shell: bash -l {0}
run: |
conda info
- name: Install package
shell: bash -l {0}
run: |
pip install -e .
- name: Test with coverage
shell: bash -l {0}
run: |
pytest -v --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
test-on-windows:
runs-on: ${{ matrix.operating-system }}
strategy:
max-parallel: 16
fail-fast: false
matrix:
operating-system: [windows-latest]
python-version: [3.7]
floatx: ["float32", "float64"]
test-subset:
- '
--ignore=pymc3/tests/test_examples.py
--ignore=pymc3/tests/test_distributions_random.py
--ignore=pymc3/tests/test_variational_inference.py
--ignore=pymc3/tests/test_shared.py
--ignore=pymc3/tests/test_smc.py
--ignore=pymc3/tests/test_updates.py
--ignore=pymc3/tests/test_posteriors.py
--ignore=pymc3/tests/test_sampling.py
--ignore=pymc3/tests/test_parallel_sampling.py
--ignore=pymc3/tests/test_dist_math.py
--ignore=pymc3/tests/test_distribution_defaults.py
--ignore=pymc3/tests/test_distributions_timeseries.py
--ignore=pymc3/tests/test_random.py
--ignore=pymc3/tests/test_gp.py
--ignore=pymc3/tests/test_shape_handling
--ignore=pymc3/tests/test_quadpotential.py
'
- '
pymc3/tests/test_distributions_random.py
pymc3/tests/test_shared.py
pymc3/tests/test_smc.py
pymc3/tests/test_sampling.py
pymc3/tests/test_parallel_sampling.py
pymc3/tests/test_dist_math.py
pymc3/tests/test_distribution_defaults.py
pymc3/tests/test_distributions_timeseries.py
pymc3/tests/test_random.py
'
- '
pymc3/tests/test_examples.py
pymc3/tests/test_posteriors.py
pymc3/tests/test_gp.py
pymc3/tests/test_quadpotential.py
'
- '
pymc3/tests/test_variational_inference.py
pymc3/tests/test_updates.py
pymc3/tests/test_shape_handling.py
'
env:
TEST_SUBSET: ${{ matrix.test-subset }}
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc.cxxflags='-march=core2'
steps:
- uses: actions/checkout@v2
- name: Cache conda and theano
uses: actions/cache@v2
env:
# Increase this value to reset cache
CACHE_NUMBER: 0
with:
path: |
~/conda_pkgs_dir
~/.theano
key: ${{ runner.os }}-${{ matrix.floatx }}-py${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}
- name: Install miniconda
uses: goanpeca/setup-miniconda@v1
with:
auto-update-conda: true
activate-environment: pymc3-dev
python-version: ${{ matrix.python-version }}
channels: conda-forge,defaults
channel-priority: strict
- name: Log conda and Python versions
shell: bash -l {0}
run: |
conda info
- name: Install build and test dependencies
shell: bash -l {0}
run: |
conda install --only-deps pymc3
conda install coverage pytest parameterized dill nose nose-parameterized python-graphviz pytest-cov
- name: Install pymc3
shell: bash -l {0}
run: |
pip install -e .
- name: Run pymc3 tests
shell: bash -l {0}
run: |
python -m pytest -v --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
1 change: 0 additions & 1 deletion pymc3/__init__.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@
def __set_compiler_flags():
# Workarounds for Theano compiler problems on various platforms
import theano

current = theano.config.gcc.cxxflags
theano.config.gcc.cxxflags = f"{current} -Wno-c++11-narrowing"