Skip to content

pr-upload-render-test-result #2359

pr-upload-render-test-result

pr-upload-render-test-result #2359

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
env:
html_filename: "linux-drawable.html"
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/get-pr-number
id: get-pr-number
- uses: ./.github/actions/download-workflow-run-artifact
with:
artifact-name: render-test-result
expect-files: ${{ env.html_filename }}
- 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/${{ env.html_filename }} \
s3://maplibre-native-test-artifacts/${{ github.run_id }}-${{ env.html_filename }} \
--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: ${{ steps.get-pr-number.outputs.pr-number }}
message: |
Render test results at https://maplibre-native-test-artifacts.s3.eu-central-1.amazonaws.com/${{ github.run_id }}-${{ env.html_filename }}