Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
maxime-desroches committed Jul 16, 2024
1 parent 471e90b commit f3ac90a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 44 deletions.
21 changes: 2 additions & 19 deletions .github/workflows/selfdrive_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
49 changes: 24 additions & 25 deletions .github/workflows/ui_preview.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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:
Expand All @@ -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 }}

Expand All @@ -40,30 +40,29 @@ 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: |
<!-- _(run_id_screenshots **${{ github.run_id }}**)_ -->
## UI Screenshots
<table>
<tr>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ inputs.pr_number }}/${{ inputs.report_name }}/screenshots/homescreen.png"></td>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ inputs.pr_number }}/${{ inputs.report_name }}/screenshots/onroad.png"></td>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/report-${{ github.event.number }}/screenshots/homescreen.png"></td>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/report-${{ github.event.number }}/screenshots/onroad.png"></td>
</tr>
<tr>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ inputs.pr_number }}/${{ inputs.report_name }}/screenshots/onroad_map.png"></td>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ inputs.pr_number }}/${{ inputs.report_name }}/screenshots/onroad_sidebar.png"></td>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/report-${{ github.event.number }}/screenshots/onroad_map.png"></td>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/report-${{ github.event.number }}/screenshots/onroad_sidebar.png"></td>
</tr>
<tr>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ inputs.pr_number }}/${{ inputs.report_name }}/screenshots/settings_network.png"></td>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ inputs.pr_number }}/${{ inputs.report_name }}/screenshots/settings_device.png"></td>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/report-${{ github.event.number }}/screenshots/settings_network.png"></td>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/report-${{ github.event.number }}/screenshots/settings_device.png"></td>
</tr>
</table>
pr_number: ${{ inputs.pr_number }}
pr_number: ${{ github.event.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f3ac90a

Please sign in to comment.