Skip to content

Commit

Permalink
Provide a fast CI option for draft status (#1082)
Browse files Browse the repository at this point in the history
  • Loading branch information
h-mayorquin authored Sep 17, 2024
1 parent 9dc05c6 commit 88a4c2f
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 26 deletions.
39 changes: 24 additions & 15 deletions .github/workflows/deploy-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ name: Deploy tests

on:
pull_request:
types: [synchronize, opened, reopened, ready_for_review] # defaults + ready_for_review
types: [synchronize, opened, reopened, ready_for_review]
# Synchronize, open and reopened are the default types for pull request
# We add ready_for_review to trigger the check for changelog and full tests when ready for review is clicked
merge_group:
workflow_dispatch:

concurrency: # Cancel previous workflows on the same pull request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

Expand All @@ -21,9 +23,9 @@ jobs:
name: Auto-detecting CHANGELOG.md updates
runs-on: ubuntu-latest
steps:
- if: ${{ needs.assess-file-changes.outputs.CHANGELOG_UPDATED == 'true' }}
- 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' }}
- if: ${{ needs.assess-file-changes.outputs.CHANGELOG_UPDATED == 'false' }}
run: |
echo "CHANGELOG.md has not been updated."
0
Expand All @@ -37,14 +39,19 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_GIN_BUCKET: ${{ secrets.S3_GIN_BUCKET }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

with: # Ternary operator: condition && value_if_true || value_if_false
python-versions: ${{ github.event.pull_request.draft == true && '["3.9"]' || '["3.9", "3.10", "3.11", "3.12"]' }}
os-versions: ${{ github.event.pull_request.draft == true && '["ubuntu-latest"]' || '["ubuntu-latest", "macos-latest", "macos-13", "windows-latest"]' }}

run-live-service-tests:
needs: assess-file-changes
if: ${{ needs.assess-file-changes.outputs.SOURCE_CHANGED == 'true' }}
uses: ./.github/workflows/live-service-testing.yml
secrets:
DANDI_API_KEY: ${{ secrets.DANDI_API_KEY }}
with: # Ternary operator: condition && value_if_true || value_if_false
python-versions: ${{ github.event.pull_request.draft == true && '["3.9"]' || '["3.9", "3.10", "3.11", "3.12"]' }}
os-versions: ${{ github.event.pull_request.draft == true && '["ubuntu-latest"]' || '["ubuntu-latest", "macos-latest", "macos-13", "windows-latest"]' }}

run-dev-tests:
needs: assess-file-changes
Expand All @@ -55,25 +62,27 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_GIN_BUCKET: ${{ secrets.S3_GIN_BUCKET }}
with: # Ternary operator: condition && value_if_true || value_if_false
python-versions: ${{ github.event.pull_request.draft == true && '["3.9"]' || '["3.9", "3.10", "3.11", "3.12"]' }}

run-doctests-only:
needs: assess-file-changes
if: ${{ needs.assess-file-changes.outputs.CONVERSION_GALLERY_CHANGED == 'true' && needs.assess-file-changes.outputs.SOURCE_CHANGED != 'true' }}
uses: ./.github/workflows/doctests.yml
with: # Ternary operator: condition && value_if_true || value_if_false
python-versions: ${{ github.event.pull_request.draft == true && '["3.9"]' || '["3.9", "3.10", "3.11", "3.12"]' }}
os-versions: ${{ github.event.pull_request.draft == true && '["ubuntu-latest"]' || '["ubuntu-latest", "macos-latest", "macos-13", "windows-latest"]' }}

check-final-status:
name: All tests passing
if: always()

needs:
- run-tests
- run-doctests-only

- run-tests
- run-doctests-only
runs-on: ubuntu-latest

steps:
- name: Decide whether the all jobs succeeded or at least one failed
uses: re-actors/alls-green@release/v1
with:
allowed-skips: run-tests, run-doctests-only # Each has the option to skip depending on whether src changed
jobs: ${{ toJSON(needs) }}
- name: Decide whether all jobs succeeded or at least one failed
uses: re-actors/alls-green@release/v1
with:
allowed-skips: run-tests, run-doctests-only
jobs: ${{ toJSON(needs) }}
8 changes: 7 additions & 1 deletion .github/workflows/dev-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Dev Branch Testing
on:
workflow_dispatch:
workflow_call:
inputs:
python-versions:
description: 'List of Python versions to use in matrix, as JSON string'
required: true
type: string
default: '["3.9", "3.10", "3.11", "3.12"]'
secrets:
DANDI_API_KEY:
required: true
Expand All @@ -22,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ${{ fromJson(inputs.python-versions) }}
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow --tags
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/doctests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
name: Run doctests
on:
workflow_call:
inputs:
python-versions:
description: 'List of Python versions to use in matrix, as JSON string'
required: true
type: string
default: '["3.9", "3.10", "3.11", "3.12"]'
os-versions:
description: 'List of OS versions to use in matrix, as JSON string'
required: true
type: string
default: '["ubuntu-latest", "macos-latest", "windows-latest"]'


jobs:
run:
Expand All @@ -9,8 +21,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ${{ fromJson(inputs.python-versions) }}
os: ${{ fromJson(inputs.os-versions) }}
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow --tags
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/live-service-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ name: Live service testing
on:
workflow_dispatch:
workflow_call:
inputs:
python-versions:
description: 'List of Python versions to use in matrix, as JSON string'
required: true
type: string
default: '["3.9", "3.10", "3.11", "3.12"]'
os-versions:
description: 'List of OS versions to use in matrix, as JSON string'
required: true
type: string
default: '["ubuntu-latest", "macos-latest", "windows-latest"]'

secrets:
DANDI_API_KEY:
required: true
Expand All @@ -16,8 +28,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ${{ fromJson(inputs.python-versions) }}
os: ${{ fromJson(inputs.os-versions) }}
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow --tags
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
name: Minimal and Full Tests

on:
workflow_call:
inputs:
python-versions:
description: 'List of Python versions to use in matrix, as JSON string'
required: true
type: string
default: '["3.9", "3.10", "3.11", "3.12"]'
os-versions:
description: 'List of OS versions to use in matrix, as JSON string'
required: true
type: string
default: '["ubuntu-latest", "macos-latest", "windows-latest"]'


secrets:
AWS_ACCESS_KEY_ID:
required: true
Expand All @@ -19,8 +33,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ${{ fromJson(inputs.python-versions) }}
os: ${{ fromJson(inputs.os-versions) }}
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow --tags
Expand Down Expand Up @@ -79,13 +93,9 @@ jobs:
#- name: Run icephys tests # There are no icephys specific tests without data
# run: pytest tests/test_icephys -rsx -n auto --dist loadscope



- name: Install full requirements
run: pip install .[full]



- name: Get ephy_testing_data current head hash
id: ephys
run: echo "::set-output name=HASH_EPHY_DATASET::$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* Add writing to zarr test for to the test on data [PR #1056](https://github.com/catalystneuro/neuroconv/pull/1056)
* Modified the CI to avoid running doctests twice [PR #1077](https://github.com/catalystneuro/neuroconv/pull/#1077)
* Consolidated daily workflows into one workflow and added email notifications [PR #1081](https://github.com/catalystneuro/neuroconv/pull/1081)
* Run only the most basic testing while a PR is on draft [PR #1082](https://github.com/catalystneuro/neuroconv/pull/1082)
* Added zarr tests for the test on data with checking equivalent backends [PR #1083](https://github.com/catalystneuro/neuroconv/pull/1083)


Expand Down

0 comments on commit 88a4c2f

Please sign in to comment.