Skip to content

Unit tests

Unit tests #448

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]
include:
- python-version: "3.8"
os: ubuntu-latest
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -e {0}
steps:
- uses: actions/checkout@v4
- 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 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 with pytest
run: pytest