Skip to content

Bump codecov/codecov-action from 4 to 5 #1546

Bump codecov/codecov-action from 4 to 5

Bump codecov/codecov-action from 4 to 5 #1546

Workflow file for this run

name: test
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on:
push:
branches: ['main', 'maint/*']
pull_request:
branches: ['main', 'maint/*']
jobs:
style:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12']
name: "Flake8 ${{ matrix.python-version }}"
steps:
- uses: actions/checkout@v4
- 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
python -m pip install -e .[test]
- name: Display versions and environment information
run: |
python --version
which python
- run: flake8 autoreject
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.10', '3.12']
steps:
- 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
python -m pip install --upgrade build twine
- uses: actions/checkout@v4
- name: Build sdist
run: python -m build --sdist
- name: Check sdist
run: twine check --strict dist/*
- name: Install sdist
run: python -m pip install ./dist/autoreject-*
- name: Clean up working directory
run: rm -rf ./*
- name: Try importing autoreject
run: python -c 'import autoreject; print(autoreject.__version__)'
- name: Remove sdist install
run: python -m pip uninstall -y autoreject
- uses: actions/checkout@v4
- name: Build wheel
run: python -m build --wheel
- name: Check wheel
run: twine check --strict dist/*
- name: Install wheel
run: python -m pip install ./dist/autoreject-*.whl
- name: Clean up working directory
run: rm -rf ./*
- name: Try importing autoreject
run: python -c 'import autoreject; print(autoreject.__version__)'
- name: Remove wheel install
run: python -m pip uninstall -y autoreject
- uses: actions/checkout@v4
- name: Test extras install
run: |
python -m pip install .[test,doc]
python -c 'import autoreject; print(autoreject.__version__)'
python -c 'import h5io; print(h5io.__version__)'
python -c 'import sphinx; print(sphinx.__version__)'
python -c 'import pytest; print(pytest.__version__)'
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10', '3.12']
mne-version: [stable, main]
env:
TZ: Europe/Berlin
FORCE_COLOR: true
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# for plotting headless
- uses: pyvista/setup-headless-display-action@main
with:
qt: true
pyvista: false
- name: Install autoreject
# lazy_loader needed for get_testing_version.sh
run: |
python -m pip install --upgrade pip
python -m pip install -e .[test]
python -m pip install lazy_loader
- name: Clone MNE-Python
run: git clone --single-branch --branch main https://github.com/mne-tools/mne-python.git
- name: Install mne (main|stable)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update && sudo apt install libegl1 -y
python -m pip install -e mne-python/
- name: Display versions and environment information
run: |
echo $TZ
date
python --version
which python
mne sys_info
# Get testing data
- run: ./tools/get_testing_version.sh
working-directory: mne-python
shell: bash
name: 'Get testing version'
- uses: actions/cache@v4
with:
key: ${{ env.TESTING_VERSION }}
path: ~/mne_data
name: 'Cache testing data'
- run: ./tools/github_actions_download.sh
shell: bash
working-directory: mne-python
- name: Run pytest
shell: bash
run: |
pytest --cov=autoreject --cov-report=xml -v autoreject/
- name: Upload coverage stats to codecov
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}