|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with 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, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +# Modelled on Apache Spark's test_report.yml. The "Build" workflow runs in the |
| 19 | +# contributor's fork (no upstream privileges); this workflow runs in the |
| 20 | +# upstream context via workflow_run, downloads the test XML artifacts the fork |
| 21 | +# uploaded, and posts the surefire report as a check run on the PR commit. |
| 22 | + |
| 23 | +name: Report test results |
| 24 | +on: |
| 25 | + workflow_run: |
| 26 | + workflows: ["Build"] |
| 27 | + types: |
| 28 | + - completed |
| 29 | + |
| 30 | +jobs: |
| 31 | + test_report: |
| 32 | + if: github.event.workflow_run.conclusion != 'skipped' |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - name: Download test results to report |
| 36 | + uses: dawidd6/action-download-artifact@09385b76de790122f4da9c82b17bccf858b9557c # pin@v2 |
| 37 | + with: |
| 38 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 39 | + workflow: ${{ github.event.workflow_run.workflow_id }} |
| 40 | + commit: ${{ github.event.workflow_run.head_commit.id }} |
| 41 | + workflow_conclusion: completed |
| 42 | + - name: Publish test report |
| 43 | + uses: scacap/action-surefire-report@482f012643ed0560e23ef605a79e8e87ca081648 # pin@v1 |
| 44 | + with: |
| 45 | + check_name: Report test results |
| 46 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + report_paths: "**/target/test-reports/*.xml" |
| 48 | + commit: ${{ github.event.workflow_run.head_commit.id }} |
0 commit comments