Skip to content

Commit

Permalink
switched deploy-tests to .txt based python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pauladkisson committed Oct 23, 2024
1 parent 94b7e49 commit ccd4b9d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/all_os_versions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["ubuntu-latest", "macos-latest", "windows-latest", "macos-13"]
1 change: 1 addition & 0 deletions .github/workflows/all_python_versions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["3.9", "3.10", "3.11", "3.12"]
28 changes: 19 additions & 9 deletions .github/workflows/deploy-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ concurrency:
cancel-in-progress: true

jobs:
load_python_and_os_versions:
runs-on: ubuntu-latest
outputs:
ALL_PYTHON_VERSIONS: ${{ steps.load_python_versions.outputs.python_versions }}
ALL_OS_VERSIONS: ${{ steps.load_os_versions.outputs.os_versions }}
steps:
- id: load_python_versions
run: echo "python_versions=$(cat ./.github/workflows/all_python_versions.txt)" >> "$GITHUB_OUTPUT"
- id: load_os_versions
run: echo "os_versions=$(cat ./.github/workflows/all_os_versions.txt)" >> "$GITHUB_OUTPUT"

assess-file-changes:
uses: ./.github/workflows/assess-file-changes.yml
Expand All @@ -31,7 +41,7 @@ jobs:
0
run-tests:
needs: assess-file-changes
needs: [assess-file-changes, load_python_and_os_versions]
if: ${{ needs.assess-file-changes.outputs.SOURCE_CHANGED == 'true' }}
uses: ./.github/workflows/testing.yml
secrets:
Expand All @@ -40,28 +50,28 @@ jobs:
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"]' || vars.ALL_PYTHON_VERSIONS }}
os-versions: ${{ github.event.pull_request.draft == true && '["ubuntu-latest"]' || vars.ALL_OS_VERSIONS }}
python-versions: ${{ github.event.pull_request.draft == true && '["3.9"]' || needs.load_python_and_os_versions.outputs.ALL_PYTHON_VERSIONS }}
os-versions: ${{ github.event.pull_request.draft == true && '["ubuntu-latest"]' || needs.load_python_and_os_versions.outputs.ALL_OS_VERSIONS }}

# If the conversion gallery is the only thing that changed, run doctests only
run-doctests-only:
needs: assess-file-changes
needs: [assess-file-changes, load_python_and_os_versions]
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"]' || vars.ALL_PYTHON_VERSIONS }}
os-versions: ${{ github.event.pull_request.draft == true && '["ubuntu-latest"]' || vars.ALL_OS_VERSIONS }}
python-versions: ${{ github.event.pull_request.draft == true && '["3.9"]' || needs.load_python_and_os_versions.outputs.ALL_PYTHON_VERSIONS }}
os-versions: ${{ github.event.pull_request.draft == true && '["ubuntu-latest"]' || needs.load_python_and_os_versions.outputs.ALL_OS_VERSIONS }}


run-live-service-tests:
needs: assess-file-changes
needs: [assess-file-changes, load_python_and_os_versions]
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"]' || vars.ALL_PYTHON_VERSIONS }}
os-versions: ${{ github.event.pull_request.draft == true && '["ubuntu-latest"]' || vars.ALL_OS_VERSIONS }}
python-versions: ${{ github.event.pull_request.draft == true && '["3.9"]' || needs.load_python_and_os_versions.outputs.ALL_PYTHON_VERSIONS }}
os-versions: ${{ github.event.pull_request.draft == true && '["ubuntu-latest"]' || needs.load_python_and_os_versions.outputs.ALL_OS_VERSIONS }}


check-final-status:
Expand Down

0 comments on commit ccd4b9d

Please sign in to comment.