| # |
| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. |
| # The ASF licenses this file to You under the Apache License, Version 2.0 |
| # (the "License"); you may not use this file except in compliance with |
| # the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| # |
| |
| name: Cloud-AWS Test Summary |
| |
| on: |
| workflow_run: |
| workflows: ["Cloud-AWS"] |
| types: |
| - completed |
| |
| permissions: |
| contents: read |
| actions: read |
| checks: write |
| statuses: write |
| |
| jobs: |
| report: |
| runs-on: ubuntu-latest |
| if: github.event.workflow_run.event == 'pull_request' |
| steps: |
| - name: S3A Test Report |
| id: report |
| uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 |
| with: |
| artifact: /s3a-test-reports-java-.*/ # see tmpl_cloud_aws.yml |
| name: S3A Integration Tests |
| path: "**/TEST-*.xml" |
| reporter: java-junit |
| only-summary: 'false' |
| # use-actions-summary is currently mutually exclusive with check run |
| # creation in dorny/test-reporter.: |
| # For now, try check run method. |
| use-actions-summary: 'false' |
| list-suites: 'failed' |
| list-tests: 'failed' |
| # list-files: 'none' |
| fail-on-error: 'false' |
| |
| - name: Post S3A commit status |
| uses: actions/github-script@v7 |
| if: always() |
| with: |
| script: | |
| const conclusion = '${{ steps.report.outputs.conclusion }}'; |
| const passed = '${{ steps.report.outputs.passed }}'; |
| const failed = '${{ steps.report.outputs.failed }}'; |
| const skipped = '${{ steps.report.outputs.skipped }}'; |
| const url = '${{ steps.report.outputs.url_html }}'; |
| |
| // Map dorny/test-reporter conclusion to a GitHub commit-status state. |
| let state, description; |
| if (conclusion === 'failure') { |
| state = 'failure'; |
| description = `${passed} pass, ${failed} fail, ${skipped} skip`; |
| } else if (conclusion === 'success') { |
| state = 'success'; |
| description = `${passed} pass, ${failed} fail, ${skipped} skip`; |
| } else { |
| state = 'error'; |
| description = 'Test report unavailable (no results found or reporter error)'; |
| } |
| |
| const params = { |
| ...context.repo, |
| sha: context.payload.workflow_run.head_sha, |
| state, |
| description, |
| context: 'S3A Test Summary', |
| }; |
| if (url) params.target_url = url; |
| |
| await github.rest.repos.createCommitStatus(params); |