|
| 1 | +# --------------------------------------------------------------------------- |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | +# contributor license agreements. See the NOTICE file distributed with |
| 4 | +# this work for additional information regarding copyright ownership. |
| 5 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | +# (the "License"); you may not use this file except in compliance with |
| 7 | +# the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# --------------------------------------------------------------------------- |
| 17 | + |
| 18 | +name: Build report |
| 19 | + |
| 20 | +on: |
| 21 | + workflow_run: |
| 22 | + workflows: |
| 23 | + - "build" |
| 24 | + types: |
| 25 | + - completed |
| 26 | + |
| 27 | +permissions: |
| 28 | + actions: write |
| 29 | + checks: write |
| 30 | + pull-requests: write |
| 31 | + |
| 32 | +env: |
| 33 | + TEST_REPORTS_ARTIFACT_NAME: will-be-read-from-env-file |
| 34 | + PR_NUMBER_ARTIFACT_NAME: will-be-read-from-env-file |
| 35 | + TEST_REPORTS_NAME: will-be-read-from-env-file |
| 36 | + |
| 37 | +jobs: |
| 38 | + report: |
| 39 | + if: ${{ github.event.workflow_run.event == 'pull_request' }} |
| 40 | + runs-on: ubuntu-latest |
| 41 | + |
| 42 | + steps: |
| 43 | + - name: Checkout code |
| 44 | + uses: actions/checkout@v4 |
| 45 | + |
| 46 | + - name: Setup environment variables |
| 47 | + uses: ./.github/actions/setup-env |
| 48 | + |
| 49 | + - name: Download ${{ env.PR_NUMBER_ARTIFACT_NAME }} |
| 50 | + uses: actions/download-artifact@v4 |
| 51 | + with: |
| 52 | + github-token: ${{ github.token }} |
| 53 | + name: ${{ env.PR_NUMBER_ARTIFACT_NAME }} |
| 54 | + run-id: ${{ github.event.workflow_run.id }} |
| 55 | + |
| 56 | + - name: Set PR number |
| 57 | + id: set-pr-number |
| 58 | + run: | |
| 59 | + echo "pr-number=$(cat pr-number.txt)" >> "${GITHUB_OUTPUT}" |
| 60 | + rm -rf pr-number.txt |
| 61 | +
|
| 62 | + - name: Publish reports |
| 63 | + uses: turing85/publish-report@v2 |
| 64 | + with: |
| 65 | + comment-message-pr-number: ${{ steps.set-pr-number.outputs.pr-number }} |
| 66 | + download-artifact-name: ${{ env.TEST_REPORTS_ARTIFACT_NAME }} |
| 67 | + download-artifact-run-id: ${{ github.event.workflow_run.id }} |
| 68 | + report-name: ${{ env.TEST_REPORTS_NAME }} |
| 69 | + report-path: '**/target/**/TEST*.xml' |
0 commit comments