chore(ci): Update CI to run tox, pipx #1
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: Python tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
schedule: | |
- cron: '30 12 1 * *' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set git name/email | |
run: | | |
git config --global user.email "bids.maintenance@gmail.com" | |
git config --global user.name "bids-maintenance" | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
- name: Install git-annex ubuntu | |
if: matrix.platform == 'ubuntu-latest' | |
run: conda install -c conda-forge git-annex | |
- name: Install git-annex macos | |
if: matrix.platform == 'macos-latest' | |
run: brew install git-annex | |
- name: Install git-annex windows | |
if: matrix.platform == 'windows-latest' | |
uses: crazy-max/ghaction-chocolatey@v3 | |
with: | |
args: install git-annex --yes --ignore-checksums | |
continue-on-error: true # This can fail for stupid reasons ¯\_(ツ)_/¯ | |
- name: Install tox | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox tox-gh-actions | |
- name: Show tox config | |
run: tox c | |
- name: Run tox | |
run: tox -v --exit-and-dump-after 1200 | |
- uses: codecov/codecov-action@v4 | |
if: ${{ always() }} | |
- name: Check formatting | |
run: | | |
pipx run flake8 bids_validator | |
pipx run pydocstyle bids_validator |