Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve github CIs #182

Merged
merged 3 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/actions/get-testing-dataset/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Get MNE testing dataset"
description: "A composite action to get MNE testing dataset from cache or remote."

runs:
using: "composite"
steps:
- name: Get testing dataset version
shell: bash
run: curl https://raw.githubusercontent.com/mne-tools/mne-testing-data/master/version.txt -o mne_testing_data_version.txt
- name: Cache testing dataset
id: cache
uses: actions/cache@v4
with:
key: mne-testing-${{ runner.os }}-${{ hashFiles('mne_testing_data_version.txt') }}
path: ~/mne_data
- name: Download testing dataset
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
run: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
- name: Remove dataset version file
shell: bash
run: rm mne_testing_data_version.txt
6 changes: 3 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python 3.9
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --progress-bar off --upgrade pip setuptools
Expand All @@ -31,4 +30,5 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m build
twine check dist/*
twine upload dist/*
32 changes: 4 additions & 28 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,8 @@ jobs:
run: pycrostates-sys_info --developer
- name: Display MNE info
run: mne sys_info -pd
- name: Get testing dataset version
run: |
curl https://raw.githubusercontent.com/mne-tools/mne-testing-data/master/version.txt -o mne_testing_data_version.txt
- name: Cache testing dataset
id: cache
uses: actions/cache@v4
with:
key: mne-testing-${{ runner.os }}-${{ hashFiles('mne_testing_data_version.txt') }}
path: ~/mne_data
- name: Download testing dataset
if: steps.cache.outputs.cache-hit != 'true'
run: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
- name: Remove dataset version file
run: rm mne_testing_data_version.txt
- name: Get testing dataset
uses: ./.github/actions/get-testing-dataset
- name: Run pytest
run: pytest pycrostates --cov=pycrostates --cov-report=xml --cov-config=pyproject.toml
- name: Upload to codecov
Expand Down Expand Up @@ -93,20 +81,8 @@ jobs:
run: pycrostates-sys_info --developer
- name: Display MNE info
run: mne sys_info -pd
- name: Get testing dataset version
run: |
curl https://raw.githubusercontent.com/mne-tools/mne-testing-data/master/version.txt -o mne_testing_data_version.txt
- name: Cache testing dataset
id: cache
uses: actions/cache@v4
with:
key: mne-testing-${{ runner.os }}-${{ hashFiles('mne_testing_data_version.txt') }}
path: ~/mne_data
- name: Download testing dataset
if: steps.cache.outputs.cache-hit != 'true'
run: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
- name: Remove dataset version file
run: rm mne_testing_data_version.txt
- name: Get testing dataset
uses: ./.github/actions/get-testing-dataset
- name: Run pytest
run: pytest pycrostates --cov=pycrostates --cov-report=xml --cov-config=pyproject.toml
- name: Upload to codecov
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/stubs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python 3.9
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: 'x64'
python-version: 3.11
- name: Install package
run: |
python -m pip install --progress-bar off --upgrade pip setuptools
Expand Down
Loading