Skip to content

Commit

Permalink
action
Browse files Browse the repository at this point in the history
  • Loading branch information
jakethesnake420 committed Jan 30, 2024
1 parent 3f5bad0 commit 7473d9b
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/ui-compare.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: ui

on:
push:
branches:
- test-ui
pull_request:

concurrency:
group: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.run_id || github.head_ref || github.ref }}-${{ github.workflow }}-${{ github.event_name }}
cancel-in-progress: true

env:
BASE_IMAGE: openpilot-base
CL_BASE_IMAGE: openpilot-base-cl
DOCKER_LOGIN: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}

BUILD: selfdrive/test/docker_build.sh base

RUN: docker run --shm-size 1G -v $GITHUB_WORKSPACE:/tmp/openpilot -w /tmp/openpilot -e FILEREADER_CACHE=1 -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $BASE_IMAGE /bin/bash -c

BUILD_CL: selfdrive/test/docker_build.sh cl

RUN_CL: docker run --shm-size 1G -v $GITHUB_WORKSPACE:/tmp/openpilot -w /tmp/openpilot -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $CL_BASE_IMAGE /bin/bash -c


jobs:
screenshots:
name: screenshots
runs-on: ubuntu-20.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: git lfs pull
- uses: ./.github/workflows/setup-with-retry
- name: Build base docker image
run: eval "$BUILD"
- name: Build base cl image
run: eval "$BUILD_CL"
- name: Build openpilot
run: |
${{ env.RUN }} "scons -j$(nproc)"
- name: Run UI Screenshots
run: |
${{ env.RUN_CL }} "source selfdrive/test/setup_xvfb.sh && python selfdrive/ui/tests/test_ui/run.py"
- name: Upload Report
uses: actions/upload-artifact@v2
with:
name: html-report
path: |
selfdrive/ui/tests/test_ui/report/index.html
selfdrive/ui/tests/test_ui/report/screenshots
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
# uses the PR owners repo, not commaai. Need admin to change this.
# In the end a bot can post a link in the PR to the target page
with:
branch: gh-pages
repository-name: ${{ github.repository }}
target-folder: pr-${{ github.event.pull_request.number }}
folder: |
selfdrive/ui/tests/test_ui/report
- name: Append PR Link to Index
run: |
# Check out the gh-pages branch
git fetch origin gh-pages
git checkout gh-pages
# Append new link to index.html
echo "<li><a href='pr-${{ github.event.pull_request.number }}/index.html'>PR #${{ github.event.pull_request.number }} - ${GITHUB_REF}</a></li>" >> index.html
# Commit and push changes
git config user.name "github-actions"
git config user.email "[email protected]"
git add index.html
git commit -m "Update index.html with PR #${{ github.event.pull_request.number }}"
git push origin gh-pages

0 comments on commit 7473d9b

Please sign in to comment.