diff --git a/.github/workflows/deploy-tests.yml b/.github/workflows/deploy-tests.yml index 9cbf6ba94..3afd5e956 100644 --- a/.github/workflows/deploy-tests.yml +++ b/.github/workflows/deploy-tests.yml @@ -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 @@ -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 @@ -37,7 +39,9 @@ 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 @@ -45,6 +49,9 @@ jobs: 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 @@ -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) }} diff --git a/.github/workflows/dev-testing.yml b/.github/workflows/dev-testing.yml index c85d80fe0..acd7a3d74 100644 --- a/.github/workflows/dev-testing.yml +++ b/.github/workflows/dev-testing.yml @@ -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 @@ -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 diff --git a/.github/workflows/doctests.yml b/.github/workflows/doctests.yml index ed4bd7cd6..d816dbd02 100644 --- a/.github/workflows/doctests.yml +++ b/.github/workflows/doctests.yml @@ -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: @@ -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 diff --git a/.github/workflows/live-service-testing.yml b/.github/workflows/live-service-testing.yml index 28c9fff26..b9a425a8d 100644 --- a/.github/workflows/live-service-testing.yml +++ b/.github/workflows/live-service-testing.yml @@ -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 @@ -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 diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 5ccdb6c33..736da6030 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -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 @@ -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 @@ -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)" diff --git a/CHANGELOG.md b/CHANGELOG.md index 22eae5727..495184eea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)