@@ -32,10 +32,18 @@ on: # yamllint disable-line rule:truthy
3232 description : " Stringified array of all Python versions to test - separated by spaces."
3333 required : true
3434 type : string
35+ python-versions :
36+ description : " JSON-formatted array of Python versions to generate constraints for"
37+ required : true
38+ type : string
3539 generate-no-providers-constraints :
3640 description : " Whether to generate constraints without providers (true/false)"
3741 required : true
3842 type : string
43+ generate-pypi-constraints :
44+ description : " Whether to generate PyPI constraints (true/false)"
45+ required : true
46+ type : string
3947 debug-resources :
4048 description : " Whether to run in debug mode (true/false)"
4149 required : true
@@ -45,19 +53,22 @@ on: # yamllint disable-line rule:truthy
4553 required : true
4654 type : string
4755jobs :
48- generate-constraints :
56+ generate-constraints-matrix :
4957 permissions :
5058 contents : read
5159 timeout-minutes : 70
52- name : Generate constraints ${{ inputs .python-versions-list-as-string }}
60+ name : Generate constraints for ${{ matrix .python-version }} on ${{ inputs.platform }}
5361 runs-on : ${{ fromJSON(inputs.runners) }}
62+ strategy :
63+ matrix :
64+ python-version : ${{ fromJson(inputs.python-versions) }}
5465 env :
5566 DEBUG_RESOURCES : ${{ inputs.debug-resources }}
5667 GITHUB_REPOSITORY : ${{ github.repository }}
5768 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5869 GITHUB_USERNAME : ${{ github.actor }}
5970 INCLUDE_SUCCESS_OUTPUTS : " true"
60- PYTHON_VERSIONS : ${{ inputs .python-versions-list-as-string }}
71+ PYTHON_VERSION : ${{ matrix .python-version }}
6172 VERBOSE : " true"
6273 steps :
6374 - name : " Cleanup repo"
@@ -67,72 +78,61 @@ jobs:
6778 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6879 with :
6980 persist-credentials : false
70- - name : " Prepare and cleanup runner"
71- run : ./scripts/ci/prepare_and_cleanup_runner.sh
72- shell : bash
73- - name : " Install Breeze"
74- uses : ./.github/actions/breeze
75- with :
76- use-uv : ${{ inputs.use-uv }}
77- id : breeze
78- - name : " Prepare all CI images: ${{ inputs.python-versions-list-as-string}}"
79- uses : ./.github/actions/prepare_all_ci_images
81+ - name : " Prepare breeze & CI image: ${{ matrix.python-version }}"
82+ uses : ./.github/actions/prepare_breeze_and_image
8083 with :
8184 platform : ${{ inputs.platform }}
82- python-versions-list-as-string : ${{ inputs.python-versions-list-as-string }}
83- docker-volume-location : " " # TODO(jscheffl): Understand why it fails here and fix it
84- - name : " Verify all CI images ${{ inputs.python-versions-list-as-string }}"
85- run : breeze ci-image verify --run-in-parallel
85+ python : ${{ matrix.python-version }}
86+ use-uv : ${{ inputs.use-uv }}
8687 - name : " Source constraints"
8788 shell : bash
8889 run : >
89- breeze release-management generate-constraints --run-in-parallel
90+ breeze release-management generate-constraints
9091 --airflow-constraints-mode constraints-source-providers --answer yes
92+ --python "${PYTHON_VERSION}"
9193 - name : " No providers constraints"
9294 shell : bash
9395 timeout-minutes : 25
9496 run : >
95- breeze release-management generate-constraints --run-in-parallel
96- --airflow-constraints-mode constraints-no-providers --answer yes --parallelism 3
97- # The no providers constraints are only needed when we want to update constraints (in canary builds)
98- # They slow down the start of PROD image builds so we want to only run them when needed.
97+ breeze release-management generate-constraints
98+ --airflow-constraints-mode constraints-no-providers --answer yes
99+ --python "${PYTHON_VERSION}"
99100 if : inputs.generate-no-providers-constraints == 'true'
100101 - name : " Prepare updated provider distributions"
101- # In case of provider distributions which are not yet released, we build them from sources
102102 shell : bash
103103 run : >
104- breeze release-management prepare-provider-distributions --include-not-ready-providers
105- --distribution-format wheel
104+ breeze release-management prepare-provider-distributions
105+ --include-not-ready-providers --distribution-format wheel
106+ if : inputs.generate-pypi-constraints == 'true'
106107 - name : " Prepare airflow distributions"
107108 shell : bash
108109 run : >
109110 breeze release-management prepare-airflow-distributions --distribution-format wheel
111+ if : inputs.generate-pypi-constraints == 'true'
110112 - name : " Prepare task-sdk distribution"
111113 shell : bash
112114 run : >
113115 breeze release-management prepare-task-sdk-distributions --distribution-format wheel
116+ if : inputs.generate-pypi-constraints == 'true'
114117 - name : " PyPI constraints"
115118 shell : bash
116119 timeout-minutes : 25
117120 run : |
118- for PYTHON in $PYTHON_VERSIONS; do
119- breeze release-management generate-constraints --airflow-constraints-mode constraints \
120- --answer yes --python "${PYTHON}"
121- done
122- - name : " Dependency upgrade summary"
123- shell : bash
124- env :
125- PYTHON_VERSIONS : ${{ env.PYTHON_VERSIONS }}
126- run : |
127- for PYTHON_VERSION in $PYTHON_VERSIONS; do
128- echo "Summarizing Python $PYTHON_VERSION"
129- cat "files/constraints-${PYTHON_VERSION}"/*.md >> $GITHUB_STEP_SUMMARY || true
130- df -H
131- done
121+ breeze release-management generate-constraints --airflow-constraints-mode constraints \
122+ --answer yes --python "${PYTHON_VERSION}"
123+ if : inputs.generate-pypi-constraints == 'true'
132124 - name : " Upload constraint artifacts"
133125 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
134126 with :
135- name : constraints
136- path : ./files/constraints-* /constraints-*.txt
127+ name : constraints-${{ matrix.python-version }}
128+ path : ./files/constraints-${{ matrix.python-version }} /constraints-*.txt
137129 retention-days : 7
138130 if-no-files-found : error
131+ - name : " Dependency upgrade summary"
132+ shell : bash
133+ env :
134+ PYTHON_VERSION : ${{ matrix.python-version }}
135+ run : |
136+ echo "Summarizing Python $PYTHON_VERSION"
137+ cat "files/constraints-${PYTHON_VERSION}"/*.md >> $GITHUB_STEP_SUMMARY || true
138+ df -H
0 commit comments