@@ -28,6 +28,10 @@ on: # yamllint disable-line rule:truthy
2828 description : " Stringified array of all Python versions to test - separated by spaces."
2929 required : true
3030 type : string
31+ python-versions :
32+ description : " JSON-formatted array of Python versions to generate constraints for"
33+ required : true
34+ type : string
3135 generate-no-providers-constraints :
3236 description : " Whether to generate constraints without providers (true/false)"
3337 required : true
@@ -36,6 +40,10 @@ on: # yamllint disable-line rule:truthy
3640 description : " Space-separated list of providers that should be installed from context files"
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 ${{ inputs.python-versions-list-as-string }}
5361 runs-on : ${{ fromJSON(inputs.runs-on-as-json-public) }}
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 VERSION_SUFFIX_FOR_PYPI : " dev0"
6374 steps :
@@ -68,70 +79,56 @@ jobs:
6879 uses : actions/checkout@v4
6980 with :
7081 persist-credentials : false
71- - name : " Cleanup docker"
72- run : ./scripts/ci/cleanup_docker.sh
73- shell : bash
74- - name : " Install Breeze"
75- uses : ./.github/actions/breeze
76- with :
77- use-uv : ${{ inputs.use-uv }}
78- id : breeze
79- - name : " Prepare all CI images: ${{ inputs.python-versions-list-as-string}}"
80- uses : ./.github/actions/prepare_all_ci_images
82+ - name : " Prepare breeze & CI image: ${{ matrix.python-version }}"
83+ uses : ./.github/actions/prepare_breeze_and_image
8184 with :
8285 platform : " linux/amd64"
83- python-versions-list-as-string : ${{ inputs.python-versions-list-as-string }}
84- docker-volume-location : " " # TODO(jscheffl): Understand why it fails here and fix it
85- - name : " Verify all CI images ${{ inputs.python-versions-list-as-string }}"
86- run : breeze ci-image verify --run-in-parallel
86+ python : ${{ matrix.python-version }}
87+ use-uv : ${{ inputs.use-uv }}
8788 - name : " Source constraints"
8889 shell : bash
8990 run : >
90- breeze release-management generate-constraints --run-in-parallel
91+ breeze release-management generate-constraints
9192 --airflow-constraints-mode constraints-source-providers --answer yes
93+ --python "${PYTHON_VERSION}"
9294 - name : " No providers constraints"
9395 shell : bash
9496 timeout-minutes : 25
9597 run : >
96- breeze release-management generate-constraints --run-in-parallel
97- --airflow-constraints-mode constraints-no-providers --answer yes --parallelism 3
98- # The no providers constraints are only needed when we want to update constraints (in canary builds)
99- # They slow down the start of PROD image builds so we want to only run them when needed.
98+ breeze release-management generate-constraints
99+ --airflow-constraints-mode constraints-no-providers --answer yes
100+ --python "${PYTHON_VERSION}"
100101 if : inputs.generate-no-providers-constraints == 'true'
101- - name : " Prepare chicken-eggs provider packages"
102- # In case of provider packages which use latest dev0 version of providers, we should prepare them
103- # from the source code, not from the PyPI because they have apache-airflow>=X.Y.Z dependency
104- # And when we prepare them from sources they will have apache-airflow>=X.Y.Z.dev0
102+ - name : " Prepare updated provider distributions"
105103 shell : bash
106- env :
107- CHICKEN_EGG_PROVIDERS : ${{ inputs.chicken-egg-providers }}
108104 run : >
109- breeze release-management prepare-provider-packages --include-not-ready-providers
110- --package-format wheel --version-suffix-for-pypi dev0
111- ${CHICKEN_EGG_PROVIDERS}
112- if : inputs.chicken-egg-providers != ''
113- - name : " PyPI constraints"
105+ breeze release-management prepare-provider-packages
106+ --include-not-ready-providers --package-format wheel
107+ if : inputs.generate-pypi-constraints == 'true'
108+ - name : " Prepare airflow distributions"
114109 shell : bash
115- timeout-minutes : 25
116- env :
117- CHICKEN_EGG_PROVIDERS : ${{ inputs.chicken-egg-providers }}
118110 run : >
119- breeze release-management generate-constraints --run-in-parallel
120- --airflow-constraints-mode constraints --answer yes
121- --chicken-egg-providers "${CHICKEN_EGG_PROVIDERS}" --parallelism 3
122- - name : " Dependency upgrade summary"
111+ breeze release-management prepare-airflow-packages --distribution-format wheel
112+ if : inputs.generate-pypi-constraints == 'true'
113+ - name : " PyPI constraints"
123114 shell : bash
124- env :
125- PYTHON_VERSIONS : ${{ env.PYTHON_VERSIONS }}
115+ timeout-minutes : 25
126116 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- done
117+ breeze release-management generate-constraints --airflow-constraints-mode constraints \
118+ --answer yes --python "${PYTHON_VERSION}"
119+ if : inputs.generate-pypi-constraints == 'true'
131120 - name : " Upload constraint artifacts"
132- uses : actions/upload-artifact@v4
121+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
133122 with :
134- name : constraints
135- path : ./files/constraints-* /constraints-*.txt
123+ name : constraints-${{ matrix.python-version }}
124+ path : ./files/constraints-${{ matrix.python-version }} /constraints-*.txt
136125 retention-days : 7
137126 if-no-files-found : error
127+ - name : " Dependency upgrade summary"
128+ shell : bash
129+ env :
130+ PYTHON_VERSION : ${{ matrix.python-version }}
131+ run : |
132+ echo "Summarizing Python $PYTHON_VERSION"
133+ cat "files/constraints-${PYTHON_VERSION}"/*.md >> $GITHUB_STEP_SUMMARY || true
134+ df -H
0 commit comments