mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-10-27 08:33:45 +08:00
22a8575199
Keep official openpilot ancestry and dependency licenses. Store resources directly in Git, remove LFS setup requirements, and leave the downloadable big model outside the source tree.
230 lines
8.3 KiB
YAML
230 lines
8.3 KiB
YAML
name: tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- Domathon
|
|
pull_request:
|
|
workflow_dispatch:
|
|
workflow_call:
|
|
inputs:
|
|
run_number:
|
|
default: '1'
|
|
required: true
|
|
type: string
|
|
|
|
concurrency:
|
|
group: tests-ci-run-${{ inputs.run_number }}-${{ 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:
|
|
CI: 1
|
|
PYTHONPATH: ${{ github.workspace }}
|
|
|
|
jobs:
|
|
source_integrity:
|
|
name: source integrity
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Validate tracked dependencies
|
|
run: python3 tools/vendor/check.py --revision HEAD
|
|
- name: Test dependency and packaging tools
|
|
run: |
|
|
python3 -m unittest discover -s tools/vendor/tests -v
|
|
python3 -m unittest discover -s tools/release/tests -v
|
|
python3 -m unittest discover -s openpilot/system/updated/tests -v
|
|
- name: Check setup and release shell syntax
|
|
run: |
|
|
for script in tools/op.sh tools/release/*.sh openpilot/selfdrive/test/setup_device_ci.sh; do
|
|
bash -n "$script"
|
|
done
|
|
|
|
build_release:
|
|
name: build release
|
|
runs-on: ${{
|
|
(github.repository == 'commaai/openpilot') &&
|
|
((github.event_name != 'pull_request') ||
|
|
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))
|
|
&& fromJSON('["namespace-profile-amd64-8x16"]')
|
|
|| fromJSON('["ubuntu-24.04"]') }}
|
|
env:
|
|
STRIPPED_DIR: /tmp/releasepilot
|
|
PYTHONPATH: /tmp/releasepilot
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Build devel
|
|
timeout-minutes: 1
|
|
run: TARGET_DIR=$STRIPPED_DIR tools/release/build_stripped.sh
|
|
- run: ./tools/op.sh setup
|
|
- name: Build openpilot and run checks
|
|
timeout-minutes: 30
|
|
working-directory: ${{ env.STRIPPED_DIR }}
|
|
run: python3 openpilot/system/manager/build.py
|
|
- name: Run tests
|
|
timeout-minutes: 1
|
|
working-directory: ${{ env.STRIPPED_DIR }}
|
|
run: tools/release/check-dirty.sh
|
|
- name: Check tracked dependencies
|
|
timeout-minutes: 3
|
|
run: python3 tools/vendor/check.py --revision HEAD
|
|
|
|
build_mac:
|
|
name: build macOS
|
|
runs-on: ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-macos-8x14' || 'macos-latest' }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Remove Homebrew from environment
|
|
run: |
|
|
FILTERED=$(echo "$PATH" | tr ':' '\n' | grep -v '/opt/homebrew' | tr '\n' ':')
|
|
echo "PATH=${FILTERED}/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" >> $GITHUB_ENV
|
|
- run: ./tools/op.sh setup
|
|
- name: Building openpilot
|
|
run: scons
|
|
|
|
static_analysis:
|
|
name: static analysis
|
|
runs-on: ${{
|
|
(github.repository == 'commaai/openpilot') &&
|
|
((github.event_name != 'pull_request') ||
|
|
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))
|
|
&& fromJSON('["namespace-profile-amd64-8x16"]')
|
|
|| fromJSON('["ubuntu-24.04"]') }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- run: ./tools/op.sh setup
|
|
- name: Static analysis
|
|
timeout-minutes: 1
|
|
run: scripts/lint/lint.sh
|
|
|
|
unit_tests:
|
|
name: unit tests
|
|
runs-on: ${{
|
|
(github.repository == 'commaai/openpilot') &&
|
|
((github.event_name != 'pull_request') ||
|
|
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))
|
|
&& fromJSON('["namespace-profile-amd64-8x16"]')
|
|
|| fromJSON('["ubuntu-24.04"]') }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- run: ./tools/op.sh setup
|
|
- name: Build openpilot
|
|
run: scons
|
|
- name: Run unit tests
|
|
timeout-minutes: ${{ contains(runner.name, 'nsc') && 2 || 20 }}
|
|
env:
|
|
RAYLIB_BACKEND: headless
|
|
run: tools/op.sh test
|
|
|
|
process_replay:
|
|
name: process replay
|
|
runs-on: ${{
|
|
(github.repository == 'commaai/openpilot') &&
|
|
((github.event_name != 'pull_request') ||
|
|
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))
|
|
&& fromJSON('["namespace-profile-amd64-8x16"]')
|
|
|| fromJSON('["ubuntu-24.04"]') }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- run: ./tools/op.sh setup
|
|
- name: Build openpilot
|
|
run: scons
|
|
- name: Run replay
|
|
timeout-minutes: ${{ contains(runner.name, 'nsc') && 2 || 20 }}
|
|
run: openpilot/selfdrive/test/process_replay/test_processes.py -j$(nproc)
|
|
- name: Print diff
|
|
id: print-diff
|
|
if: always()
|
|
run: cat openpilot/selfdrive/test/process_replay/diff.txt
|
|
- name: Print diff report
|
|
if: always()
|
|
run: cat openpilot/selfdrive/test/process_replay/diff_report.txt
|
|
- uses: actions/upload-artifact@v7
|
|
if: always()
|
|
continue-on-error: true
|
|
with:
|
|
name: process_replay_diff.txt
|
|
path: openpilot/selfdrive/test/process_replay/diff.txt
|
|
- name: Upload diff report
|
|
uses: actions/upload-artifact@v7
|
|
if: always() && github.event_name == 'pull_request'
|
|
continue-on-error: true
|
|
with:
|
|
name: diff_report_${{ github.event.number }}
|
|
path: openpilot/selfdrive/test/process_replay/diff_report.txt
|
|
- name: Checkout ci-artifacts
|
|
if: github.repository == 'commaai/openpilot' && github.ref == 'refs/heads/master'
|
|
uses: actions/checkout@v7
|
|
with:
|
|
repository: commaai/ci-artifacts
|
|
ssh-key: ${{ secrets.CI_ARTIFACTS_DEPLOY_KEY }}
|
|
path: ${{ github.workspace }}/ci-artifacts
|
|
- name: Prepare refs
|
|
if: github.repository == 'commaai/openpilot' && github.ref == 'refs/heads/master'
|
|
working-directory: ${{ github.workspace }}/ci-artifacts
|
|
run: |
|
|
git config user.name "GitHub Actions Bot"
|
|
git config user.email "<>"
|
|
git fetch origin process-replay || true
|
|
git checkout process-replay 2>/dev/null || git checkout --orphan process-replay
|
|
cp ${{ github.workspace }}/openpilot/selfdrive/test/process_replay/fakedata/*.zst .
|
|
echo "${{ github.sha }}" > ref_commit
|
|
git add .
|
|
git commit -m "process-replay refs for ${{ github.repository }}@${{ github.sha }}" || echo "No changes to commit"
|
|
- name: Push refs
|
|
if: github.repository == 'commaai/openpilot' && github.ref == 'refs/heads/master'
|
|
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60
|
|
with:
|
|
timeout_minutes: 2
|
|
max_attempts: 3
|
|
command: cd ${{ github.workspace }}/ci-artifacts && git push origin process-replay --force
|
|
|
|
simulator_driving:
|
|
name: simulator driving
|
|
runs-on: ${{
|
|
(github.repository == 'commaai/openpilot') &&
|
|
((github.event_name != 'pull_request') ||
|
|
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))
|
|
&& fromJSON('["namespace-profile-amd64-8x16"]')
|
|
|| fromJSON('["ubuntu-24.04"]') }}
|
|
if: false # FIXME: Started to timeout recently
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- run: ./tools/op.sh setup
|
|
- name: Build openpilot
|
|
run: scons
|
|
- name: Driving test
|
|
timeout-minutes: 2
|
|
env:
|
|
# MetaDrive renders offscreen through panda3d's EGL pipe on llvmpipe
|
|
EGL_PLATFORM: surfaceless
|
|
run: python openpilot/tools/sim/tests/test_metadrive_bridge.py
|
|
|
|
create_ui_report:
|
|
name: Create UI Report
|
|
runs-on: ${{
|
|
(github.repository == 'commaai/openpilot') &&
|
|
((github.event_name != 'pull_request') ||
|
|
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))
|
|
&& fromJSON('["namespace-profile-amd64-8x16"]')
|
|
|| fromJSON('["ubuntu-24.04"]') }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- run: ./tools/op.sh setup
|
|
- name: Build openpilot
|
|
run: scons
|
|
- name: Create UI Report
|
|
env:
|
|
RAYLIB_BACKEND: headless
|
|
run: |
|
|
python3 openpilot/selfdrive/ui/tests/diff/replay.py
|
|
python3 openpilot/selfdrive/ui/tests/diff/replay.py --big
|
|
- name: Upload UI Report
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: ui-report-${{ inputs.run_number || '1' }}-${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && 'master' || github.event.number }}
|
|
path: openpilot/selfdrive/ui/tests/diff/report
|