Skip to content

Commit 2cb4c5f

Browse files
author
zhou jielei
committed
Merge branch 'master' of github.com:leonunix/opendbc
* 'master' of github.com:leonunix/opendbc: (524 commits) safety: remove board/ folder (commaai#2814) safety: namespace helpers (commaai#2813) always build libsafety for mutation tests (commaai#2811) build system cleanups (commaai#2810) move mull install to setup.sh utils == helpers (commaai#2809) consolidate libsafety files (commaai#2808) safety: cleanup remaining panda bits (commaai#2807) docs: Scheduled auto-update CARS.md Honda: Acura TLX 2021 support (commaai#2717) HKG: Add FW for 2017 Hyundai Ioniq Hybrid (commaai#2784) Honda - Update extra cars (commaai#2801) Add new fingerprints for Tesla Model X (commaai#2710) docs: Scheduled auto-update CARS.md Revert "Capnp memoryview (commaai#2793)" Capnp memoryview (commaai#2793) Honda: 2026 Honda Passport (commaai#2657) Honda: Merge Kinematics (commaai#2797) HKG: Add FW for 2023 Hyundai Elantra (commaai#2796) HKG: Add FW for 2024 Genesis GV70 (commaai#2787) ... # Conflicts: # docs/CARS.md # opendbc/car/honda/carstate.py # opendbc/car/honda/interface.py # opendbc/car/honda/values.py # opendbc/car/tests/routes.py # opendbc/car/torque_data/substitute.toml # opendbc/safety/modes/honda.h
2 parents bff3cab + aa3d32a commit 2cb4c5f

File tree

304 files changed

+10359
-9589
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

304 files changed

+10359
-9589
lines changed

.github/pull_request_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!--
2+
We need these details to verify your pull request.
3+
4+
Find your device's dongle ID and a route at https://connect.comma.ai.
5+
Ideally, the route is recorded with the exact branch of your pull request.
6+
-->
7+
Validation
8+
* Dongle ID:
9+
* Route:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'Restore cache'
2+
runs:
3+
using: "composite"
4+
steps:
5+
- name: Restore cached cppcheck
6+
id: cppcache
7+
uses: actions/cache@v4
8+
with:
9+
path: opendbc/safety/tests/misra/cppcheck/
10+
key: cppcheck-cache-${{ runner.os }}-${{ hashFiles('opendbc/safety/tests/misra/install.sh') }}
11+
- name: Set cache-hit output
12+
run: echo "cache-hit=${{ steps.cppcache.outputs.cache-hit }}" >> $GITHUB_OUTPUT
13+
shell: bash

.github/workflows/pr_draft.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Re-draft on review
2+
on:
3+
pull_request_review:
4+
types: [submitted]
5+
6+
jobs:
7+
redraft:
8+
# TODO: doesn't work due to perms issue. https://github.com/commaai/opendbc/actions/runs/16079182504/job/45380739128?pr=2385
9+
if: false
10+
#if: github.event.review.state == 'changes_requested'
11+
permissions:
12+
pull-requests: write
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- run: gh pr ready --undo "${{ github.event.pull_request.number }}"
17+
env:
18+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/repo.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/test_models_trigger.yaml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 55 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ jobs:
1515
matrix:
1616
include:
1717
- os: ${{ github.repository == 'commaai/opendbc' && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
18-
- os: macos-latest
18+
- os: ${{ github.repository == 'commaai/opendbc' && 'namespace-profile-macos-8x14' || 'macos-latest' }}
1919
steps:
20-
- uses: commaai/timeout@v1
2120
- uses: actions/checkout@v4
21+
- uses: ./.github/workflows/cache
22+
id: cache
23+
- uses: commaai/timeout@v1
24+
with:
25+
timeout: ${{ github.repository == 'commaai/opendbc' && (steps.cache.outputs.cache-hit == 'true' && '60' || '90') || '999' }}
2226
- run: ./test.sh
2327

2428
safety_tests:
@@ -27,81 +31,71 @@ jobs:
2731
strategy:
2832
fail-fast: false
2933
matrix:
30-
flags: ['', '--ubsan']
34+
flags: ['--ubsan']
3135
steps:
3236
- uses: commaai/timeout@v1
37+
with:
38+
timeout: ${{ github.repository == 'commaai/opendbc' && '60' || '999' }}
3339
- uses: actions/checkout@v4
40+
- uses: ./.github/workflows/cache
3441
- name: Run safety tests
3542
run: ./opendbc/safety/tests/test.sh ${{ matrix.flags }}
3643

37-
misra_linter:
38-
name: MISRA C:2012 Linter
39-
runs-on: ${{ github.repository == 'commaai/opendbc' && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
40-
timeout-minutes: 20
41-
steps:
42-
- name: Set up
43-
run: sudo apt-get install -y --no-install-recommends gcc-arm-none-eabi libnewlib-arm-none-eabi
44-
- uses: actions/checkout@v4
45-
- name: Restore cached cppcheck
46-
uses: actions/cache@v4
47-
with:
48-
path: opendbc/safety/tests/misra/cppcheck/
49-
key: cppcheck-cache-${{ runner.os }}-${{ github.ref }}
50-
restore-keys: |
51-
cppcheck-cache-${{ runner.os }}-${{ github.ref }}
52-
cppcheck-cache-${{ runner.os }}-
53-
- name: Run MISRA C:2012 analysis
54-
timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 1 || 2) }}
55-
run: cd opendbc/safety/tests/misra && ./test_misra.sh
56-
- name: Save cppcheck cache
57-
uses: actions/cache@v4
58-
with:
59-
path: opendbc/safety/tests/misra/cppcheck/
60-
key: cppcheck-cache-${{ runner.os }}-${{ github.ref }}
61-
62-
misra_mutation:
63-
name: MISRA C:2012 Mutation
64-
runs-on: ${{ github.repository == 'commaai/opendbc' && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
65-
timeout-minutes: 20
66-
steps:
67-
- name: Set up
68-
run: sudo apt-get install -y --no-install-recommends gcc-arm-none-eabi libnewlib-arm-none-eabi
69-
- uses: actions/checkout@v4
70-
- name: Restore cached cppcheck
71-
uses: actions/cache@v4
72-
with:
73-
path: opendbc/safety/tests/misra/cppcheck/
74-
key: cppcheck-cache-${{ runner.os }}-${{ github.ref }}
75-
restore-keys: |
76-
cppcheck-cache-${{ runner.os }}-${{ github.ref }}
77-
cppcheck-cache-${{ runner.os }}-
78-
- name: MISRA mutation tests
79-
timeout-minutes: 1
80-
run: |
81-
source setup.sh
82-
scons -j8
83-
cd opendbc/safety/tests/misra
84-
./install.sh # cppcheck
85-
pytest -s -n8 --randomly-seed $RANDOM test_mutation.py
86-
- name: Save cppcheck cache
87-
uses: actions/cache@v4
88-
with:
89-
path: opendbc/safety/tests/misra/cppcheck/
90-
key: cppcheck-cache-${{ runner.os }}-${{ github.ref }}
91-
9244
mutation:
9345
name: Safety mutation tests
9446
runs-on: ${{ github.repository == 'commaai/opendbc' && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
95-
timeout-minutes: 20
47+
timeout-minutes: 45
9648
env:
97-
GIT_REF: ${{ github.event_name == 'push' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}' && github.event.before || 'origin/${{ github.event.repository.default_branch }}' }}
49+
GIT_REF: ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.event.before || format('origin/{0}', github.event.repository.default_branch) }}
9850
steps:
9951
- uses: actions/checkout@v4
10052
with:
10153
fetch-depth: 0 # need master to get diff
54+
- uses: ./.github/workflows/cache
10255
- name: Run mutation tests
103-
timeout-minutes: 5
10456
run: |
10557
source setup.sh
10658
scons -j8
10759
cd opendbc/safety/tests && ./mutation.sh
60+
61+
# TODO: this needs to move to opendbc
62+
test_models:
63+
name: test models
64+
runs-on: ${{ github.repository == 'commaai/opendbc' && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
job: [0, 1, 2, 3]
69+
env:
70+
BASE_IMAGE: openpilot-base
71+
BUILD: selfdrive/test/docker_build.sh base
72+
RUN: docker run --shm-size 2G -v $PWD:/tmp/openpilot -w /tmp/openpilot -e CI=1 -e PYTHONWARNINGS=error -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
73+
PYTEST: pytest --continue-on-collection-errors --durations=0 --durations-min=5 -n logical
74+
steps:
75+
- uses: actions/checkout@v4
76+
with:
77+
repository: 'commaai/openpilot'
78+
ref: 'master'
79+
submodules: true
80+
- run: rm -rf opendbc_repo/
81+
- uses: actions/checkout@v4
82+
with:
83+
path: opendbc_repo
84+
- uses: ./.github/workflows/setup-with-retry
85+
id: setup-step
86+
- name: Cache test routes
87+
id: routes-cache
88+
uses: actions/cache@v4
89+
with:
90+
path: .ci_cache/comma_download_cache
91+
key: car_models-${{ hashFiles('selfdrive/car/tests/test_models.py', 'opendbc/car/tests/routes.py') }}-${{ matrix.job }}
92+
- name: Build openpilot
93+
run: ${{ env.RUN }} "scons -j$(nproc) common/ cereal/ selfdrive/pandad/ msgq_repo/ opendbc_repo"
94+
- name: Test car models
95+
timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.routes-cache.outputs.cache-hit == 'true') && ((steps.setup-step.outputs.duration < 18) && 1 || 2) || 6 }}
96+
run: |
97+
${{ env.RUN }} "MAX_EXAMPLES=1 $PYTEST selfdrive/car/tests/test_models.py && \
98+
chmod -R 777 /tmp/comma_download_cache"
99+
env:
100+
NUM_JOBS: 4
101+
JOB_ID: ${{ matrix.job }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Update cppcheck
2+
3+
on:
4+
#push:
5+
schedule:
6+
- cron: "0 14 * * 1" # every Monday at 2am UTC (6am PST)
7+
workflow_dispatch:
8+
9+
jobs:
10+
update-cppcheck:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Get latest cppcheck version
18+
id: version
19+
run: |
20+
LATEST=$(curl -fsSL https://api.github.com/repos/danmar/cppcheck/releases/latest | jq -r .tag_name)
21+
echo "vers=$LATEST" >> "$GITHUB_OUTPUT"
22+
- name: Update VERS in install.sh
23+
run: |
24+
sed -i "s/^VERS=\".*\"/VERS=\"${{ steps.version.outputs.vers }}\"/" opendbc/safety/tests/misra/install.sh
25+
grep VERS opendbc/safety/tests/misra/install.sh
26+
- name: Create Pull Request
27+
uses: peter-evans/create-pull-request@9153d834b60caba6d51c9b9510b087acf9f33f83
28+
with:
29+
author: Vehicle Researcher <[email protected]>
30+
token: ${{ secrets.ACTIONS_CREATE_PR_PAT }}
31+
commit-message: "[bot] Update cppcheck to ${{ steps.version.outputs.vers }}"
32+
title: "[bot] Update cppcheck to ${{ steps.version.outputs.vers }}"
33+
body: "See all cppcheck releases: https://github.com/danmar/cppcheck/releases"
34+
branch: "update-cppcheck"
35+
base: "master"
36+
delete-branch: true
37+
labels: bot

.gitignore

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.cache/
12
/build/
23
.mypy_cache/
34
*.pyc
@@ -15,16 +16,20 @@
1516
*.html
1617
*.gcda
1718
*.gcno
18-
19+
*.dump
20+
*.gcov
1921
uv.lock
22+
/dist/
23+
.vscode/
24+
__pycache__/
25+
mull.yml
26+
*.profraw
2027

2128
opendbc/can/build/
2229
opendbc/can/obj/
23-
opendbc/can/packer_pyx.cpp
24-
opendbc/can/parser_pyx.cpp
25-
opendbc/can/packer_pyx.html
26-
opendbc/can/parser_pyx.html
2730
opendbc/dbc/*_generated.dbc
2831

2932
cppcheck-addon-ctu-file-list
3033
opendbc/safety/tests/coverage-out
34+
35+
compile_commands.json

.pre-commit-config.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
include opendbc/car/car.capnp
22
include opendbc/car/include/c++.capnp
3+
recursive-include opendbc/safety *.h

0 commit comments

Comments
 (0)