From aa9b425e593768b9382bb863b1f246d80cc83392 Mon Sep 17 00:00:00 2001 From: Paul Adkisson Date: Mon, 8 Apr 2024 21:39:05 -0400 Subject: [PATCH] added changelog check to tests (#302) --- .github/workflows/assess-file-changes.yml | 53 +++++++++++++++++++++++ .github/workflows/run-tests.yml | 16 +++++++ CHANGELOG.md | 30 ++++++++++++- 3 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/assess-file-changes.yml diff --git a/.github/workflows/assess-file-changes.yml b/.github/workflows/assess-file-changes.yml new file mode 100644 index 00000000..cf867563 --- /dev/null +++ b/.github/workflows/assess-file-changes.yml @@ -0,0 +1,53 @@ +name: Assess file changes + +on: + workflow_call: + # Map the workflow outputs to job outputs + outputs: + SOURCE_CHANGED: + description: "Whether the files under /src/ were changed." + value: ${{ jobs.build.outputs.SOURCE_CHANGED }} + CHANGELOG_UPDATED: + description: "Whether or the CHANGELOG.md file was updated." + value: ${{ jobs.build.outputs.CHANGELOG_UPDATED }} + +jobs: + build: + runs-on: ubuntu-latest + # Map the job outputs to step outputs + outputs: + SOURCE_CHANGED: ${{ steps.assess-changes.outputs.SOURCE_CHANGED }} + CHANGELOG_UPDATED: ${{ steps.assess-changes.outputs.CHANGELOG_UPDATED }} + + name: Test changed-files + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v29.0.4 + + - name: Assess Source Code Changes + id: assess-changes + run: | + echo "SOURCE_CHANGED=false" >> $GITHUB_OUTPUT + echo "CHANGELOG_UPDATED=false" >> $GITHUB_OUTPUT + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + echo $file + if [[ $file == "src/"* || $file == "tests/"* || $file == "requirements-minimal.txt" || $file == "requirements-testing.txt" || $file == "setup.py" || $file == ".github/"* ]] + then + echo "Source changed" + echo "SOURCE_CHANGED=true" >> $GITHUB_OUTPUT + else + echo "Source not changed" + fi + if [[ $file == "CHANGELOG.md" ]] + then + echo "Changelog updated" + echo "CHANGELOG_UPDATED=true" >> $GITHUB_OUTPUT + else + echo "Changelog not updated" + fi + done diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 1723bbd9..f3f2c071 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,6 +15,22 @@ jobs: - run: | echo 'The triggering workflow failed.' 0 + assess-file-changes: + uses: ./.github/workflows/assess-file-changes.yml + + detect-changelog-updates: + needs: assess-file-changes + if: ${{ needs.assess-file-changes.outputs.SOURCE_CHANGED == 'true' }} + name: Auto-detecting CHANGELOG.md updates + runs-on: ubuntu-latest + steps: + - if: ${{ needs.assess-file-changes.outputs.CHANGELOG_UPDATED == 'true' }} + run: echo "CHANGELOG.md has been updated." + - if: ${{ needs.assess-file-changes.outputs.CHANGELOG_UPDATED == 'false' }} + run: | + echo "CHANGELOG.md has not been updated." + 0 + on-success: name: Full tests on ${{ matrix.os }} with Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 25c933bc..2b7bcfea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,41 @@ # Upcoming -### Improvements -* Improved xml parsing with Bruker [PR #267](https://github.com/catalystneuro/roiextractors/pull/267) +### Features + +### Fixes + +# v0.5.7 ### Features + * Add support to get background components: add `get_background_ids()`, `get_background_image_masks()`, `get_background_pixel_masks()` to `SegmentationExtractor`. [PR #291](https://github.com/catalystneuro/roiextractors/pull/291) * Add distinction for raw roi response and denoised roi response in `CaimanSegmentationExtractor`: [PR #291](https://github.com/catalystneuro/roiextractors/pull/291) * Bug fix for the `CaimanSegmentationExtractor`: correctly extract temporal and spatial background components [PR #291](https://github.com/catalystneuro/roiextractors/pull/291) +* Added automatic version update workflow file that will run after publishing a new release to pypi: [PR #290](https://github.com/catalystneuro/roiextractors/pull/290) + +* Added `ScanImageTiffSinglePlaneMultiFileImagingExtractor` and `ScanImageTiffMultiPlaneMultiFileImagingExtractor`: [PR #297](https://github.com/catalystneuro/roiextractors/pull/297/files) + +* Added automatic changelog checking in the test workflow: [PR #302](https://github.com/catalystneuro/roiextractors/pull/302) + +### Fixes + +* Improved xml parsing with Bruker [PR #267](https://github.com/catalystneuro/roiextractors/pull/267) + +* Fixed a bug with `ScanImageTiffSinglePlaneImagingExtractor` in which `frames_per_slice` would be set to `_num_frames`: [PR #294](https://github.com/catalystneuro/roiextractors/pull/294) + +# v0.5.6 + +### Features + +* Added support for red channel (anatomical) ROIs from suite2p in Suite2pSegmentationExtractor: [PR #270](https://github.com/catalystneuro/roiextractors/pull/270) + +* Added support for RoiGroup metadata in the `extract_extra_metadata` function for ScanImageTiff files: [PR #272](https://github.com/catalystneuro/roiextractors/pull/272) + +* Updated documentation and Readme PRs: [#283](https://github.com/catalystneuro/roiextractors/pull/283) [#282](https://github.com/catalystneuro/roiextractors/pull/282) [#280](https://github.com/catalystneuro/roiextractors/pull/280) + # v0.5.5 ### Features