forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched to Run Checks for Building Images. (apache#11276)
Replaces the annoying comments with "workflow_run" links with Run Checks. Now we will be able to see the "Build Image" checks in the "Checks" section including their status and direct link to the steps running the image builds as "Details" link. Unfortunately Github Actions do not handle well the links to details - even if you provide details_url to link to the other run, the "Build Image" checks appear in the original workflow, that's why we had to introduce another link in the summary of the Build Image check that links to the actual workflow.
- Loading branch information
Showing
1 changed file
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,11 +66,6 @@ jobs: | |
cancelMode: duplicates | ||
sourceRunId: ${{ github.event.workflow_run.id }} | ||
notifyPRCancel: true | ||
notifyPRMessageStart: | | ||
The CI and PROD Docker Images for the build are prepared in a separate "Build Image" workflow, | ||
that you will not see in the list of checks (you will see "Wait for images" jobs instead). | ||
You can checks the status of those images in | ||
- name: "Output BUILD_IMAGES" | ||
id: build-images | ||
run: | | ||
|
@@ -274,6 +269,21 @@ jobs: | |
else | ||
echo "::set-output name=proceed::false" | ||
fi | ||
- name: Initiate Github Checks for Building image | ||
uses: LouisBrunner/[email protected] | ||
id: build-image-check | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
name: "Status of image build ${{ matrix.image-type }}: ${{ matrix.python-version }}" | ||
status: "in_progress" | ||
sha: ${{ needs.cancel-workflow-runs.outputs.sourceHeadSha }} | ||
details_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
output: > | ||
{"summary": | ||
"Building the image: ${{ matrix.image-type }}: ${{ matrix.python-version }}. See the | ||
[Image Build](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
for details" } | ||
if: steps.defaults.outputs.proceed == 'true' | ||
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} ) to 'main-airflow' to use main scripts" | ||
uses: actions/checkout@v2 | ||
with: | ||
|
@@ -307,6 +317,21 @@ jobs: | |
- name: "Push PROD images ${{ matrix.python-version }}:${{ github.event.workflow_run.id }}" | ||
run: ./scripts/ci/images/ci_push_production_images.sh | ||
if: matrix.image-type == 'PROD' && steps.defaults.outputs.proceed == 'true' | ||
- name: Update Github Checks for Building image with status | ||
uses: LouisBrunner/[email protected] | ||
if: always() && steps.defaults.outputs.proceed == 'true' | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
check_id: ${{ steps.build-image-check.outputs.check_id }} | ||
status: "completed" | ||
sha: ${{ needs.cancel-workflow-runs.outputs.sourceHeadSha }} | ||
conclusion: ${{ job.status }} | ||
details_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
output: > | ||
{"summary": | ||
"Building the image: ${{ matrix.image-type }}: ${{ matrix.python-version }}. See the | ||
[Image Build](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
for details" } | ||
cancel-on-build-failure: | ||
name: "Cancel 'CI Build' jobs on build image failure" | ||
|