Skip to content

Commit 1984c5d

Browse files
authored
Change CI from travis to github action (#23)
1 parent b237fda commit 1984c5d

4 files changed

Lines changed: 43 additions & 33 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
unit:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [3.6]
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install .[test]
25+
pip freeze
26+
- name: Lint with flake8
27+
run: |
28+
make lint
29+
- name: Run unit tests
30+
run: |
31+
pytest -vs --tb=short test

.travis.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

test/test_dispatch.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616

1717
@pytest.mark.filterwarnings("ignore", category=UserWarning)
1818
@pytest.mark.parametrize('model', MODELS)
19-
@pytest.mark.parametrize('backend', ['pyro', 'numpy'])
19+
@pytest.mark.parametrize('backend', [
20+
"pyro",
21+
pytest.param('numpy', marks=[pytest.mark.xfail(
22+
reason="Signature of numpyro MCMC does not match, numpyro/issues/1321")])])
2023
def test_mcmc_interface(model, backend):
2124
pytest.importorskip(PACKAGE_NAME[backend])
2225
with pyro_backend(backend), handlers.seed(rng_seed=20):

test/test_tests.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66
from pyroapi import pyro_backend
77
from pyroapi.tests import * # noqa F401
88

9-
pytestmark = pytest.mark.filterwarnings("ignore::numpyro.compat.util.UnsupportedAPIWarning")
9+
pytestmark = pytest.mark.filterwarnings(
10+
"ignore::numpyro.compat.util.UnsupportedAPIWarning",
11+
"ignore:.*loss does not support models with discrete latent variables:UserWarning",
12+
# The behavior of using // with negative numbers is changed in PyTorch.
13+
# But we don't need to worry about it. This UserWarning will be removed in
14+
# a future version of PyTorch.
15+
"ignore:.*floordiv.* is deprecated, and its behavior will change in a future version:UserWarning",
16+
)
1017

1118
PACKAGE_NAME = {
1219
"pyro": "pyro",

0 commit comments

Comments
 (0)