Skip to content

Commit

Permalink
added changelog check to tests (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauladkisson authored Apr 9, 2024
1 parent eeffbd7 commit aa9b425
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 2 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/assess-file-changes.yml
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
30 changes: 28 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit aa9b425

Please sign in to comment.