1010
1111concurrency :
1212 group : ${{ github.workflow }}-${{ github.ref }}
13- cancel-in-progress : true
13+ cancel-in-progress : true
14+
15+ jobs :
16+ load_python_and_os_versions :
17+ runs-on : ubuntu-latest
18+ outputs :
19+ ALL_PYTHON_VERSIONS : ${{ steps.load_python_versions.outputs.python_versions }}
20+ ALL_OS_VERSIONS : ${{ steps.load_os_versions.outputs.os_versions }}
21+ steps :
22+ - uses : actions/checkout@v4
23+ - id : load_python_versions
24+ run : echo "python_versions=$(cat ./.github/workflows/all_python_versions.txt)" >> "$GITHUB_OUTPUT"
25+ - id : load_os_versions
26+ run : echo "os_versions=$(cat ./.github/workflows/all_os_versions.txt)" >> "$GITHUB_OUTPUT"
27+ - name : Debugging
28+ run : |
29+ echo "Loaded Python versions: ${{ steps.load_python_versions.outputs.python_versions }}"
30+ echo "Loaded OS versions: ${{ steps.load_os_versions.outputs.os_versions }}"
31+
32+ assess-file-changes :
33+ uses : ./.github/workflows/assess-file-changes.yml
34+
35+ run-tests :
36+ needs : [assess-file-changes, load_python_and_os_versions]
37+ if : ${{ needs.assess-file-changes.outputs.SOURCE_CHANGED == 'true' }}
38+ uses : ./.github/workflows/run-tests.yml
39+ secrets :
40+ RCLONE_CONFIG : ${{ secrets.RCLONE_CONFIG }}
41+ with : # Ternary operator: condition && value_if_true || value_if_false
42+ python-versions : ${{ github.event.pull_request.draft == true && '["3.10"]' || needs.load_python_and_os_versions.outputs.ALL_PYTHON_VERSIONS }}
43+ os-versions : ${{ github.event.pull_request.draft == true && '["ubuntu-latest"]' || needs.load_python_and_os_versions.outputs.ALL_OS_VERSIONS }}
44+
45+ check-final-status :
46+ name : All tests passing
47+ if : always()
48+ needs :
49+ - run-tests
50+ runs-on : ubuntu-latest
51+ steps :
52+ - name : Decide whether all jobs succeeded or at least one failed
53+ uses : re-actors/alls-green@release/v1
54+ with :
55+ allowed-skips : run-tests
56+ jobs : ${{ toJSON(needs) }}
0 commit comments