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

[MAINT] update workflow and fix example #905

Merged
merged 1 commit into from
Sep 11, 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
126 changes: 67 additions & 59 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "main"
pull_request:
branches:
- '*'
- "*"

concurrency:
group: testing-${{ github.ref }}
Expand All @@ -26,37 +26,37 @@ jobs:
- id: result_step
uses: mstachniuk/ci-skip@master
with:
commit-filter: '[skip ci];[ci skip];[skip github]'
commit-filter-separator: ';'
commit-filter: "[skip ci];[ci skip];[skip github]"
commit-filter-separator: ";"

run_unit_tests:
name: Unit tests
needs: check_skip
if: ${{ needs.check_skip.outputs.skip == 'false' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: 'Set up python'
- name: "Set up python"
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: 'Install NiMARE'
python-version: ${{ matrix.python-version }}
- name: "Install NiMARE"
shell: bash {0}
run: pip install -e .[tests,cbmr]
- name: 'Run tests'
- name: "Run tests"
shell: bash {0}
run: make unittest
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: unit_${{ matrix.os }}_${{ matrix.python-version }}
path: coverage.xml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (performance): Consider using a matrix strategy for performance tests

The jobs for performance tests (estimators, correctors, smoke) are very similar. Consider using a matrix strategy to define these jobs, which could reduce duplication and make the workflow easier to maintain.

  test_performance:
    name: Performance tests
    if: ${{ needs.check_skip.outputs.skip == 'false' }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        test-type: [estimators, correctors, smoke]
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: '3.10'
      - name: Run ${{ matrix.test-type }} test
        run: make performance-${{ matrix.test-type }}

Expand All @@ -68,27 +68,27 @@ jobs:
if: ${{ needs.check_skip.outputs.skip == 'false' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: 'Set up python'
- name: "Set up python"
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: 'Install NiMARE'
python-version: 3.8
- name: "Install NiMARE"
shell: bash {0}
run: pip install -e .[minimum,tests,cbmr]
- name: 'Run tests'
- name: "Run tests"
shell: bash {0}
run: make unittest
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: unit_minimum
path: coverage.xml
Expand All @@ -100,27 +100,27 @@ jobs:
if: ${{ needs.check_skip.outputs.skip == 'false' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: 'Set up python'
- name: "Set up python"
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: 'Install NiMARE'
python-version: ${{ matrix.python-version }}
- name: "Install NiMARE"
shell: bash {0}
run: pip install -e .[tests,cbmr]
- name: 'Run tests'
- name: "Run tests"
shell: bash {0}
run: make test_performance_estimators
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: performance_estimator
path: coverage.xml
Expand All @@ -132,27 +132,27 @@ jobs:
if: ${{ needs.check_skip.outputs.skip == 'false' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: 'Set up python'
- name: "Set up python"
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: 'Install NiMARE'
python-version: ${{ matrix.python-version }}
- name: "Install NiMARE"
shell: bash {0}
run: pip install -e .[tests,cbmr]
- name: 'Run tests'
- name: "Run tests"
shell: bash {0}
run: make test_performance_correctors
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: performance_corrector
path: coverage.xml
Expand All @@ -164,27 +164,27 @@ jobs:
if: ${{ needs.check_skip.outputs.skip == 'false' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: 'Set up python'
- name: "Set up python"
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: 'Install NiMARE'
python-version: ${{ matrix.python-version }}
- name: "Install NiMARE"
shell: bash {0}
run: pip install -e .[tests,cbmr]
- name: 'Run tests'
- name: "Run tests"
shell: bash {0}
run: make test_performance_smoke
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: performance_smoke
path: coverage.xml
Expand All @@ -196,41 +196,49 @@ jobs:
if: ${{ needs.check_skip.outputs.skip == 'false' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: 'Set up python'
- name: "Set up python"
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: 'Install NiMARE'
python-version: ${{ matrix.python-version }}
- name: "Install NiMARE"
shell: bash {0}
run: pip install -e .[tests]
- name: 'Run tests'
- name: "Run tests"
shell: bash {0}
run: make test_cbmr_importerror
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: cbmr_importerror
path: coverage.xml
if: success()

upload_to_codecov:
name: Upload coverage
needs: [run_unit_tests,run_unit_tests_with_minimum_dependencies,test_performance_estimators,test_performance_correctors,test_performance_smoke,test_cbmr_importerror]
needs:
[
run_unit_tests,
run_unit_tests_with_minimum_dependencies,
test_performance_estimators,
test_performance_correctors,
test_performance_smoke,
test_cbmr_importerror,
]
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
- name: Upload to CodeCov
uses: codecov/codecov-action@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion examples/02_meta-analyses/12_plot_ibma_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
###############################################################################
# Contribution table
# ``````````````````````````````````````````````````````````````````````````````
result.tables["z_corr-FDR_method-indep_diag-Jackknife_tab-counts_tail-positive"]
result.tables["z_corr-FDR_method-indep_diag-Jackknife_tab-counts"]

###############################################################################
# Report
Expand Down
Loading