Skip to content

pr-upload-render-test-result #1628

pr-upload-render-test-result

pr-upload-render-test-result #1628

name: pr-upload-render-test-result
permissions:
pull-requests: write # This is required to leave a comment on the PR
id-token: write # This is required for requesting the AWS JWT
on:
workflow_run:
workflows: [linux-ci]
types:
- completed
jobs:
upload-render-test-result:
runs-on: ubuntu-22.04
if: github.event.workflow_run.event == 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/download-workflow-run-artifact
with:
artifact-name: render-test-result
expect-files: "metrics/linux-gcc8-release-style.html"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ github.run_id }}
- name: Upload render test results to S3
id: upload_render_test_results
run: |
aws s3 cp metrics/linux-gcc8-release-style.html \
s3://maplibre-native-test-artifacts/${{ github.run_id }}-linux-gcc8-release-style.html \
--expires "$(date -d '+30 days' --utc +'%Y-%m-%dT%H:%M:%SZ')"
- name: 'Leave comment on PR with test results'
uses: marocchino/sticky-pull-request-comment@v2
with:
header: render-test-result
number: ${{ github.event.workflow_run.pull_requests[0].number }}
message: |
Render test results at https://maplibre-native-test-artifacts.s3.eu-central-1.amazonaws.com/${{ github.run_id }}-linux-gcc8-release-style.html