Skip to content

Commit

Permalink
add test GH action, remove old tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
janfb committed Jan 23, 2025
1 parent a5ef03b commit bfd09cf
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 52 deletions.
1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,5 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
pip install -e .[dev]
54 changes: 54 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Tests

on: [pull_request, workflow_dispatch]

defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
ci:
name: CI
runs-on: ubuntu-latest
if: |
github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.pull_request.draft == false)
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.12']

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: false

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Cache dependency
id: cache-dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: Run the fast tests
run: |
pytest -v -x -n auto -m "not slow" tests/
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,7 @@ filterwarnings = [
"ignore::PendingDeprecationWarning"
]
testpaths = ["tests"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]
xfail_strict = true
11 changes: 0 additions & 11 deletions tests/algorithms/test_pyro_mcmc.py

This file was deleted.

40 changes: 0 additions & 40 deletions tests/tasks/test_task_rej_abc_demo.py

This file was deleted.

0 comments on commit bfd09cf

Please sign in to comment.