Skip to content

Tests

Tests #1526

Workflow file for this run

name: Tests
on:
schedule: # Every night at 5am
- cron: '0 5 * * *'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
push:
branches:
- main # is activated once a PR gets merged
jobs:
Test_Karabo:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Conda
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
- name: Install Deps
shell: bash -el {0}
run: |
conda create -y -n test_karabo python=3.9
conda activate test_karabo
mamba env update --file environment.yaml
pip install -e ".[dev]"
python -m ipykernel install --user --name python3
- name: Test Dev-Tools
shell: bash -l {0}
run: |
conda activate test_karabo
flake8 .
black --check .
isort --check .
mypy .
- name: Test Code
shell: bash -l {0}
run: |
conda activate test_karabo
export IS_GITHUB_RUNNER=true RUN_GPU_TESTS=false RUN_NOTEBOOK_TESTS=true
mpirun -n 2 pytest --only-mpi
pytest --cov=./ --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
fail_ci_if_error: false
name: codecov-karabo