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

Provide a fast CI option for draft status #1082

Merged
merged 18 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
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
50 changes: 44 additions & 6 deletions .github/workflows/deploy-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ 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 defaults 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:

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,15 +39,35 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_GIN_BUCKET: ${{ secrets.S3_GIN_BUCKET }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

with:
python-versions: > # Ternary operator: condition && value_if_true || value_if_false
${{github.event.pull_request.draft == true
&& '["3.9"]'
pauladkisson marked this conversation as resolved.
Show resolved Hide resolved
|| '["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:
pauladkisson marked this conversation as resolved.
Show resolved Hide resolved
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:
python-versions: > # Ternary operator, condition && value_if_true || value_if_false
${{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
if: ${{ needs.assess-file-changes.outputs.SOURCE_CHANGED == 'true' }}
Expand All @@ -55,12 +77,28 @@ 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:
python-versions: > # Ternary operator, condition && value_if_true || value_if_false
${{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:
python-versions: > # Ternary operator: condition && value_if_true || value_if_false
${{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()
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/dev-testing.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: Dev Branch Testing
on:
schedule:
- cron: "0 16 * * *" # Daily at noon EST
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 @@ -23,7 +27,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
18 changes: 14 additions & 4 deletions .github/workflows/live-service-testing.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
name: Live service testing
on:
schedule:
- cron: "0 16 * * *" # Daily at noon EST
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 @@ -17,8 +27,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.python-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
Loading