Skip to content

Commit

Permalink
added test workflows (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhroom authored Aug 9, 2024
1 parent 5b53621 commit 5a62efe
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Workflow file for slow tests & on multiple python versions
name: Integration tests
on:
pull_request_review:
types: [approved]
workflow_dispatch: # <-- can be triggered manually!

jobs:
integration-tests:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
python-version: [3.10, 3.11, 3.12]
steps:
- name: Set up Python version ${{ matrix.version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version }}
- name: Install package and requirements
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install .
- name: Run pytest
run: pytest -s tests/ --cov=rascal2 --cov-report=term
36 changes: 36 additions & 0 deletions .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Workflow file for fast unit tests which run on all commits
name: Unit tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
- uses: chartboost/ruff-action@v1
with:
args: 'format --check'

unit-tests:
name: Unit tests
needs: ruff # avoid wasting CI time if static analysis failed
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13]

steps:
- uses: actions/checkout@v4
- name: Set up Conda environment from environment.yaml
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment.yaml
auto-activate-base: false
- name: Install RasCAL2
run: pip install .
- name: Run pytest
run: pytest -s tests/ -m "not slow" --cov=rascal2 --cov-report=term
3 changes: 3 additions & 0 deletions tests/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
markers =
slow: marks slow tests which only run on review

0 comments on commit 5a62efe

Please sign in to comment.