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

Push pipeline results to the wiki #85

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
879271f
Dummy change to test 2T6S pipeline on CI with rectified results data
bclenet Aug 25, 2023
812d518
[REFAC] 2T6S pipeline
bclenet Aug 29, 2023
eeee10e
[BUG] cleaning connections
bclenet Aug 29, 2023
1b0170e
[BUG] cleaning connections
bclenet Aug 29, 2023
360dcd0
[TEST] init a test for conftest.py
bclenet Aug 30, 2023
babdf1b
[ENH] modifying actions workflows
bclenet Aug 31, 2023
608acc3
Merge branch 'main' into 2T6S-refactoring
bclenet Aug 31, 2023
6986e90
[BUG] inside unit_tests workflow
bclenet Aug 31, 2023
d48322c
Merge branch 'main' into ci-github-4
bclenet Aug 31, 2023
d6e67f3
Merge branch 'Inria-Empenn:main' into main
bclenet Aug 31, 2023
77ab264
Merge branch 'main' into 2T6S-refactoring
bclenet Aug 31, 2023
691a039
Merge branch 'main' into conftest_testing
bclenet Sep 1, 2023
0f8365a
[TEST] testing the conftest module
bclenet Sep 1, 2023
20d66c3
Merge branch 'conftest_testing' into 2T6S-refactoring
bclenet Sep 1, 2023
a653f8b
Issue with parameters dir creation
bclenet Sep 4, 2023
c3bfc53
Merge branch 'Inria-Empenn:main' into main
bclenet Sep 4, 2023
d19fdf0
Merge branch 'main' into 2T6S-refactoring
bclenet Sep 4, 2023
58dbe61
Merge branch 'main' into ci-github-4
bclenet Sep 5, 2023
1642bd8
[CI] correlation results displayed in the wiki
bclenet Sep 5, 2023
e56bb63
Bug with makedirs import
bclenet Sep 5, 2023
68866c0
[DOC] update documentation about workflows
bclenet Sep 7, 2023
e8b154e
Report results for pull_requests as well
bclenet Sep 7, 2023
e8d2f02
Merge branch '2T6S-refactoring' into ci-github-4
bclenet Sep 8, 2023
50e2828
Change job trigger condition
bclenet Sep 8, 2023
7368586
Dummy change to test 2T6S pipeline
bclenet Sep 8, 2023
399aa35
Change job trigger condition
bclenet Sep 8, 2023
0483680
[CI] create an export job for the pipeline_tests workflow
bclenet Sep 14, 2023
4b30504
Merge branch 'Inria-Empenn:main' into main
bclenet Sep 19, 2023
fd15ffc
Merge branch 'Inria-Empenn:main' into main
bclenet Sep 21, 2023
6ebe5d2
Merge branch 'Inria-Empenn:main' into main
bclenet Sep 29, 2023
0a584dd
Merge branch 'Inria-Empenn:main' into main
bclenet Sep 29, 2023
e284b80
Merge branch 'Inria-Empenn:main' into main
bclenet Sep 29, 2023
c6b6c0c
Merge branch 'main' into ci-github-4
bclenet Sep 29, 2023
434695a
Dummy change to trigger pipeline test
bclenet Sep 29, 2023
08d81d7
Using cache in test report workflow
bclenet Oct 3, 2023
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
58 changes: 56 additions & 2 deletions .github/workflows/pipeline_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ jobs:
pytest -s -q -m "pipeline_test" ${{ needs.identify-tests.outputs.tests }}
fi

- name: Cache test results
if: ${{ always() }}
uses: actions/cache@v3
with:
key: cache-test-results-${{github.run_id}}
path: test_pipeline-*.txt

- name: Archive pipeline execution failures
if: ${{ failure() }} # Run only if previous job fails
uses: actions/upload-artifact@v3
Expand All @@ -82,8 +89,20 @@ jobs:
crash-*.pklz
retention-days: 15

- name: Report results on GitHub
if: ${{ always() }}
# A job to report the test results
tests-report:
needs: [identify-tests, pytest]
runs-on: ubuntu-latest
if: ${{ always() }}
steps:

- name: Restore cache with test results
uses: actions/cache@v3
with:
key: cache-test-results-${{github.run_id}}
path: test_pipeline-*.txt

- name: Report results on step summary
run: |
# Start report
echo "# Correlation values" >> $GITHUB_STEP_SUMMARY
Expand All @@ -97,5 +116,40 @@ jobs:
# Loop through test report files
for team in ${{ needs.identify-tests.outputs.teams }}
do
# Retrieve the report from GITHUB_ENV, as set up by the pytest job
cat test_pipeline-$team.txt >> $GITHUB_STEP_SUMMARY
done

- name: Checkout wiki
uses: actions/checkout@v3
with:
repository: ${{github.repository}}.wiki
path: wiki

- name: Report results on the project's wiki
run: |
# Loop through test report files & write them to the corresponding wiki page
for team in ${{ needs.identify-tests.outputs.teams }}
do
echo "# Correlation values for pipeline $team \n" > wiki/pipeline_$team.md
echo "Unthresholded maps, reproduced vs. results \n" >> wiki/pipeline_$team.md
echo "Correlation values are sorted from hypotheses 1 to 9 \n" >> wiki/pipeline_$team.md
echo "These values were calculated by GitHub Actions run [# $GITHUB_RUN_ID]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID) \n" >> wiki/pipeline_$team.md
echo "| Team | Number of subjects | Test status | Correlation values |" >> wiki/pipeline_$team.md
echo "| -------- | ------- | ------- | ------- |" >> wiki/pipeline_$team.md

# Retrieve the report from GITHUB_ENV, as set up by the pytest job
cat test_pipeline-$team.txt >> wiki/pipeline_$team.md
done

# Push changes
cd wiki
git config user.name github-actions
git config user.email [email protected]

# Test if there are changes in the repository before commiting
if [[ $(git diff --name-only) ]]; then
git add .
git commit -m "Pipeline status updated"
git push
fi
3 changes: 2 additions & 1 deletion docs/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ For now, the following workflows are set up:
| ----------- | ----------- | ----------- | ----------- | ----------- |
| [code_quality](/.github/workflows/code_quality.yml) | A static analysis of the python code (see the [testing](/docs/testing.md) topic of the documentation for more information). | For every push or pull_request if there are changes on `.py` files. | On GitHub servers. | Outputs (logs of pylint) are stored as [downloadable artifacts](https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts) during 15 days after the push. |
| [codespell](/.github/workflows/codespell.yml) | A static analysis of the text files for commonly made typos using [codespell](codespell-project/codespell: check code for common misspellings). | For every push or pull_request to the `maint` branch. | On GitHub servers. | Outputs (logs of codespell) are stored as [downloadable artifacts](https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts) during 15 days after the push. |
| [pipeline_tests](/.github/workflows/pipelines.yml) | Runs all the tests for changed pipelines. | For every push or pull_request, if a pipeline file changed. | On Empenn runners. | Outputs (logs of pytest) are stored as downloadable artifacts during 15 days after the push. |
| [pipeline_status](/.github/workflows/pipeline_status.yml) | Generates a page with pipelines statuses. | For every push on the `main` branch, if a pipeline file changed. Or if issues changed. | On GitHub servers. | Outputs (status table) is pushed to the dedicated [page](https://github.com/Inria-Empenn/narps_open_pipelines/wiki/pipeline_status) on the project's wiki. |
| [pipeline_tests](/.github/workflows/pipeline_tests.yml) | Runs all the tests for changed pipelines. | For every push or pull_request, if a pipeline file changed. | On Empenn runners. | Outputs (logs of pytest) are stored as downloadable artifacts during 15 days after the push. Results of pipeline are pushed to a dedicated page on the project's wiki. |
| [test_changes](/.github/workflows/test_changes.yml) | It runs all the changed tests for the project. | For every push or pull_request, if a test file changed. | On Empenn runners. | Outputs (logs of pytest) are stored as downloadable artifacts during 15 days after the push. |
| [unit_testing](/.github/workflows/unit_testing.yml) | It runs all the unit tests for the project (see the [testing](/docs/testing.md) topic of the documentation for more information). | For every push or pull_request, if a file changed inside `narps_open/`, or a file related to test execution. | On GitHub servers. | Outputs (logs of pytest) are stored as downloadable artifacts during 15 days after the push. |

Expand Down
2 changes: 1 addition & 1 deletion narps_open/pipelines/team_2T6S.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python
# coding: utf-8

""" Write the work of NARPS team 2T6S using Nipype """
""" Write the work of NARPS' team 2T6S using Nipype """

from os.path import join
from itertools import product
Expand Down
Loading