diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index b6bd93fe31452f..9a78072c6890a2 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -320,8 +320,6 @@ jobs: create_ui_report: name: Create UI Report runs-on: ubuntu-latest - outputs: - ui_diff: ${{ steps.changed-files.outputs.any_changed }} steps: - uses: actions/checkout@v4 with: @@ -337,20 +335,5 @@ jobs: - name: Save Test Report uses: actions/upload-artifact@v4 with: - name: report-${{ inputs.run_number || '1' }} - path: selfdrive/ui/tests/test_ui/report_${{ inputs.run_number || '1' }} - - 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/** - - post_ui_report: - needs: create_ui_report - if: ${{ github.event_name == 'pull_request' && github.repository == 'commaai/openpilot' && needs.create_ui_report.outputs.ui_diff == 'true' }} - uses: commaai/openpilot/.github/workflows/ui_preview.yaml@fix_ui_preview - with: - pr_number: ${{ github.event.number }} - report_name: report-${{ inputs.run_number || '1' }} + name: report-${{ github.event.number }} + path: selfdrive/ui/tests/test_ui/report_1 diff --git a/.github/workflows/ui_preview.yaml b/.github/workflows/ui_preview.yaml index 1e0fb5ff927b41..26fe59f6f4d9b8 100644 --- a/.github/workflows/ui_preview.yaml +++ b/.github/workflows/ui_preview.yaml @@ -1,24 +1,24 @@ name: ui preview on: - workflow_call: - inputs: - pr_number: - required: true - type: number - report_name: - required: true - type: string - -permissions: - contents: read - pull-requests: write + pull_request_target: + types: [opened, reopened, synchronize, edited] + paths: + - 'selfdrive/ui/**' # only run on change in the ui jobs: preview: runs-on: ubuntu-latest - timeout-minutes: 2 + timeout-minutes: 5 steps: + - name: Wait for ui report + uses: lewagon/wait-on-check-action@v1.3.4 + with: + ref: ${{ github.ref }} + check-name: 'create_ui_report' + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 5 + - name: Checkout ci-artifacts uses: actions/checkout@v4 with: @@ -30,7 +30,7 @@ jobs: - name: Download build artifacts uses: actions/download-artifact@v4 with: - name: ${{ inputs.report_name }} + name: report-${{ github.event.number }} path: ${{ github.workspace }}/ci-artifacts github-token: ${{ secrets.GITHUB_TOKEN }} @@ -40,12 +40,11 @@ jobs: git checkout -b openpilot/pr-${{ inputs.pr_number }} git config user.name "GitHub Actions Bot" git config user.email "<>" - git add ${{ github.workspace }}/ci-artifacts - git commit -m "screenshots for PR #${{ inputs.pr_number }}" - git push origin openpilot/pr-${{ inputs.pr_number }} --force + git add ${{ github.workspace }}/ci-artifacts/screenshots + git commit -m "screenshots for PR #${{ github.event.number }}" + git push origin openpilot/pr-${{ github.event.number }} --force - name: Comment Screenshots on PR - if: ${{ github.event_name == 'pull_request' }} uses: thollander/actions-comment-pull-request@v2 with: message: | @@ -53,17 +52,17 @@ jobs: ## UI Screenshots - - + + - - + + - - + +
- pr_number: ${{ inputs.pr_number }} + pr_number: ${{ github.event.number }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}