Maint: volume.fetch
#2273
Workflow file for this run
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] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- run: pip install flake8 | |
- run: flake8 . | |
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.12', '3.11', '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: 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.12', '3.11', '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.12', '3.11', '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' |