diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index db763923b9..3359f2a15e 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -328,3 +328,53 @@ jobs: with: name: report-${{ inputs.run_number }} path: selfdrive/ui/tests/test_ui/report_${{ inputs.run_number }} + - name: Get changes to selfdrive/ui + if: ${{ github.event_name == 'pull_request' }} + id: changed-files + uses: tj-actions/changed-files@v44 + with: + files: | + selfdrive/ui/** + - name: Checkout ci-artifacts + if: ${{ github.event_name == 'pull_request' && steps.changed-files.outputs.any_changed == 'true' }} + uses: actions/checkout@v4 + with: + repository: commaai/ci-artifacts + ssh-key: ${{ secrets.CI_ARTIFACTS_DEPLOY_KEY }} + path: ${{ github.workspace }}/ci-artifacts + ref: master + - name: Push Screenshots + if: ${{ github.event_name == 'pull_request' && steps.changed-files.outputs.any_changed == 'true' }} + working-directory: ${{ github.workspace }}/ci-artifacts + run: | + git checkout -b openpilot/pr-${{ github.event.pull_request.number }} + git config user.name "GitHub Actions Bot" + git config user.email "<>" + sudo mv ${{ github.workspace }}/selfdrive/ui/tests/test_ui/report/screenshots/* . + git add . + git commit -m "screenshots for PR #${{ github.event.pull_request.number }}" + git push origin openpilot/pr-${{ github.event.pull_request.number }} --force + - name: Comment Screenshots on PR + if: ${{ github.event_name == 'pull_request' && steps.changed-files.outputs.any_changed == 'true' }} + uses: thollander/actions-comment-pull-request@v2 + with: + message: | + + ## UI Screenshots + + + + + + + + + + + + + +
+ comment_tag: run_id_screenshots + pr_number: ${{ github.event.pull_request.number }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}