Skip to content

Commit

Permalink
Re-add conditional prod image build (#45320)
Browse files Browse the repository at this point in the history
Prod image build sometimes (quite often) is not needed. When
removing `pull_request_target` in #45266 `wait-for=prod-images`
had the condition that prevented it from running (and the
`build-prod-images` step depended on it) - but this condition
is gone now.

Instead of preventing the whole composite workflow from running,
we are adding it to "build-prod-packages" so that the whole
workflow can complete as prerequisite to "finalize-tests" which
should be executed regardless from `prod-image-build` being
executed.
  • Loading branch information
potiuk authored Jan 1, 2025
1 parent cda0e9e commit 0c92638
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ jobs:
constraints-branch: ${{ needs.build-info.outputs.default-constraints-branch }}
docker-cache: ${{ needs.build-info.outputs.docker-cache }}
disable-airflow-repo-cache: ${{ needs.build-info.outputs.disable-airflow-repo-cache }}
prod-image-build: ${{ needs.build-info.outputs.prod-image-build }}

additional-prod-image-tests:
name: "Additional PROD image tests"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/prod-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,17 @@ on: # yamllint disable-line rule:truthy
description: "Disable airflow repo cache read from main."
required: true
type: string
prod-image-build:
description: "Whether this is a prod-image build (true/false)"
required: true
type: string
jobs:

build-prod-packages:
name: "Build Airflow and provider packages"
timeout-minutes: 10
runs-on: ${{ fromJSON(inputs.runs-on-as-json-public) }}
if: inputs.prod-image-build == 'true'
env:
PYTHON_MAJOR_MINOR_VERSION: "${{ inputs.default-python-version }}"
VERSION_SUFFIX_FOR_PYPI: ${{ inputs.branch == 'main' && 'dev0' || '' }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/prod-image-extra-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:
constraints-branch: ${{ inputs.constraints-branch }}
docker-cache: ${{ inputs.docker-cache }}
disable-airflow-repo-cache: ${{ inputs.disable-airflow-repo-cache }}
prod-image-build: "true"

pip-image:
uses: ./.github/workflows/prod-image-build.yml
Expand All @@ -110,3 +111,4 @@ jobs:
constraints-branch: ${{ inputs.constraints-branch }}
docker-cache: ${{ inputs.docker-cache }}
disable-airflow-repo-cache: ${{ inputs.disable-airflow-repo-cache }}
prod-image-build: "true"

0 comments on commit 0c92638

Please sign in to comment.