Skip to content

Unit tests

Unit tests #569

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Unit tests
on:
# push:
# branches: ['**']
pull_request:
branches: ['**']
create:
branches: [main]
tags: ['**']
# schedule:
# - cron: "0 4 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
# Adjust for min and max supported Python versions
python-version: ["3.12"]
os: [ubuntu-latest, windows-latest, macos-latest, macos-14] # macos-14 is Apple Silicon
include:
- python-version: "3.10"
os: ubuntu-latest
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -e {0}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python -m pip install --upgrade pip build
- name: Test building sdist
run: python -m build -s .
- name: Test building wheel
run: python -m build -w .
- name: Install openneuro-py
run: pip install .[tests]
- name: Test CLI commands
run: |
openneuro-py
openneuro-py --help
openneuro-py --version
openneuro-py download --help
openneuro-py login --help
- name: Test with pytest
run: pytest