Skip to content

Commit

Permalink
Switched to Run Checks for Building Images. (apache#11276)
Browse files Browse the repository at this point in the history
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
potiuk authored Oct 5, 2020
1 parent baa980f commit a33a919
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions .github/workflows/build-images-workflow-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit a33a919

Please sign in to comment.