Skip to content

Commit

Permalink
MAINT: Fix CIs (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Aug 17, 2023
1 parent 3f2bd3a commit f1da7cf
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 195 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Adapted from MNE-BIDS-Pipeline

name: Build
on:
on: # yamllint disable-line rule:truthy
release:
types: [published]
push:
Expand All @@ -18,39 +18,39 @@ jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build --sdist --wheel
- name: Check package
run: twine check --strict dist/*
- name: Check env vars
run: |
echo "Triggered by: ${{ github.event_name }}"
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build --sdist --wheel
- name: Check package
run: twine check --strict dist/*
- name: Check env vars
run: |
echo "Triggered by: ${{ github.event_name }}"
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist

# PyPI on release
pypi:
needs: package
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
60 changes: 60 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: 'Tests'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
push:
branches:
- '*'
pull_request:
branches:
- '*'
schedule:
- cron: "0 4 * * *"

jobs:
pytest:
name: '${{ matrix.os }} / ${{ matrix.kind }} / ${{ matrix.python }}'
continue-on-error: true
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
env:
PYTHON_VERSION: '${{ matrix.python }}'
strategy:
matrix:
include:
- os: ubuntu-latest
python: '3.11'
kind: 'dev'
- os: ubuntu-latest
python: '3.9'
kind: 'stable'
- os: macos-latest
python: '3.8'
kind: 'stable'
- os: windows-latest
python: '3.10'
kind: 'stable'
steps:
- uses: actions/checkout@v3
- uses: pyvista/setup-headless-display-action@main
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.3.1-0'
environment-file: environment.yml
init-shell: >-
bash
powershell
cache-environment: true
post-cleanup: 'all'
- run: python -m pip install --progress-bar off -e .[test] qtpy nibabel
- run: python -m pip install --upgrade git+https://github.com/mne-tools/mne-python.git@main
if: matrix.kind == 'dev'
- run: mne sys_info -p
- run: python -c "from mayavi import mlab; mlab.test_plot3d()"
- run: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
- run: pytest --tb=short --cov=mne_kit_gui --cov-report=xml --cov-report=html -vvv mne_kit_gui
- uses: codecov/codecov-action@v3
if: success()
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.284
hooks:
- id: ruff
- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
hooks:
- id: yamllint
args: [--strict, -c, .yamllint.yml]
- repo: https://github.com/mgedmin/check-manifest
rev: "0.48"
hooks:
- id: check-manifest
8 changes: 8 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: default

ignore: |
.github/workflows/codeql-analysis.yml
rules:
line-length: disable
document-start: disable
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ recursive-include mne_kit_gui/help *.json
exclude Makefile
exclude .coveragerc
exclude *.yml
exclude *.yaml
exclude ignore_words.txt
recursive-exclude mne_kit_gui *.pyc
recursive-exclude mne_kit_gui/tests/data *
156 changes: 0 additions & 156 deletions azure-pipelines.yml

This file was deleted.

2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ github_checks: # too noisy, even though "a" interactively disables them

codecov:
notify:
require_ci_to_pass: no
require_ci_to_pass: false

coverage:
status:
Expand Down
9 changes: 4 additions & 5 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: mne-kit-gui
channels:
- conda-forge
- conda-forge
dependencies:
- mne-kit-gui
# Until https://github.com/conda-forge/mayavi-feedstock/pull/74 is merged
- traitsui <8
- pyface <8
- mne-kit-gui
- traitsui
- pyface
3 changes: 0 additions & 3 deletions mne_kit_gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
#
# License: BSD-3-Clause

import os

from mne.utils import verbose, get_config
from ._backend import _testing_mode


Expand Down

0 comments on commit f1da7cf

Please sign in to comment.