Merge pull request #488 from FZJ-INM1-BDA/add_DTI_voi #1960
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: '[test] unit test' | |
on: [push] | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
env: | |
# unit tests should not need tokens | |
# KEYCLOAK_CLIENT_ID: ${{ secrets.KEYCLOAK_CLIENT_ID }} | |
# KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_CLIENT_SECRET }} | |
SIIBRA_LOG_LEVEL: DEBUG | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ '3.10', '3.9', '3.8', '3.7' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -U . | |
pip install -r requirements-test.txt | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Install test dependencies | |
run: pip install pytest pytest-cov coverage | |
- name: Run test with pytest | |
run: | | |
echo "Using github.ref: $GITHUB_REF" | |
if [[ "$GITHUB_REF" != "refs/heads/main" ]] | |
then | |
export FAST_RUN=1 | |
fi | |
pytest -rx | |
e2e-tests: | |
runs-on: ${{ matrix.os }} | |
env: | |
# KEYCLOAK_CLIENT_ID: ${{ secrets.KEYCLOAK_CLIENT_ID }} | |
# KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_CLIENT_SECRET }} | |
FOO: BAR | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ 'ubuntu-latest', 'windows-latest' ] | |
python-version: [ '3.10', '3.9', '3.8', '3.7' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache SIIBRA_CACHEDIR | |
uses: actions/cache@v3 | |
with: | |
path: ${{ runner.temp }} | |
key: ${{ runner.os }} | |
restore-keys: | | |
${{ runner.os }} | |
- name: Install dependencies | |
shell: bash | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -U . | |
pip install -r requirements-test.txt | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Install test dependencies | |
run: pip install pytest pytest-cov coverage | |
- name: Run test with pytest | |
shell: bash | |
run: | | |
export SIIBRA_CACHEDIR=${{ runner.temp }} | |
echo "Using github.ref: $GITHUB_REF" | |
if [[ "$GITHUB_REF" != "refs/heads/main" ]] | |
then | |
export FAST_RUN=1 | |
fi | |
pytest -rx e2e | |
check-importable: | |
runs-on: ubuntu-latest | |
env: | |
KEYCLOAK_CLIENT_ID: ${{ secrets.KEYCLOAK_CLIENT_ID }} | |
KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_CLIENT_SECRET }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ '3.10', '3.9', '3.8', '3.7' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -U . | |
- name: cd to / and try to import | |
run: | | |
cd / && python -c 'import siibra' |