Skip to content

Commit 1cf68eb

Browse files
committed
March 28th, 2025 Update
1 parent a8a3b4d commit 1cf68eb

Some content is hidden

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

68 files changed

+22936
-4466
lines changed
Lines changed: 265 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,265 @@
1+
name: Compile FrogPilot
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
not_vetted:
7+
description: "This branch is not vetted"
8+
required: false
9+
default: "false"
10+
type: boolean
11+
publish_frogpilot:
12+
description: "Push to FrogPilot"
13+
required: false
14+
default: "false"
15+
type: boolean
16+
publish_staging:
17+
description: "Push to FrogPilot-Staging"
18+
required: false
19+
default: "false"
20+
type: boolean
21+
publish_testing:
22+
description: "Push to FrogPilot-Testing"
23+
required: false
24+
default: "false"
25+
type: boolean
26+
publish_custom_branch:
27+
description: "Push to custom branch:"
28+
required: false
29+
default: ""
30+
type: string
31+
update_translations:
32+
description: "Update missing translations"
33+
required: false
34+
default: "false"
35+
type: boolean
36+
vet_existing_translations:
37+
description: "Vet existing translations"
38+
required: false
39+
default: "false"
40+
type: boolean
41+
42+
env:
43+
BASEDIR: "${{ github.workspace }}"
44+
BUILD_DIR: /data/openpilot
45+
OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}"
46+
47+
jobs:
48+
get_branch:
49+
runs-on: [self-hosted, c3x]
50+
outputs:
51+
branch: ${{ steps.get_branch.outputs.branch }}
52+
python_version: ${{ steps.get_python_version.outputs.python_version }}
53+
steps:
54+
- name: Determine Current Branch on Runner
55+
id: get_branch
56+
run: |
57+
cd $BUILD_DIR
58+
59+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
60+
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
61+
62+
- name: Get Python Version from Runner
63+
id: get_python_version
64+
run: |
65+
PYTHON_VERSION=$(tr -d '[:space:]' < "$BUILD_DIR/.python-version")
66+
echo "python_version=$PYTHON_VERSION" >> $GITHUB_OUTPUT
67+
68+
translate:
69+
if: inputs.update_translations
70+
needs: get_branch
71+
runs-on: ubuntu-latest
72+
steps:
73+
- name: Configure Git Identity
74+
run: |
75+
git config --global user.name "${{ github.actor }}"
76+
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
77+
78+
- name: Checkout Required Files
79+
uses: actions/checkout@v4
80+
with:
81+
ref: ${{ needs.get_branch.outputs.branch }}
82+
sparse-checkout: |
83+
selfdrive/controls/lib/alerts_offroad.json
84+
selfdrive/frogpilot/ui/
85+
selfdrive/ui/
86+
selfdrive/ui/update_translations.py
87+
selfdrive/ui/translations/
88+
selfdrive/ui/translations/auto_translate.py
89+
90+
- name: Set Up Python
91+
uses: actions/setup-python@v4
92+
with:
93+
python-version: "${{ needs.get_branch.outputs.python_version }}"
94+
95+
- name: Install Dependencies
96+
run: pip install requests
97+
98+
- name: Install Qt5 Tools
99+
run: sudo apt update && sudo apt install -y qttools5-dev-tools
100+
101+
- name: Update Translations
102+
run: |
103+
python selfdrive/ui/update_translations.py --vanish
104+
105+
- name: Translate Missing or Outdated Translations
106+
run: python selfdrive/ui/translations/auto_translate.py --all-files ${INPUT_VET:+--vet-translations}
107+
108+
- name: Commit and Push Translation Updates
109+
run: |
110+
if git diff --quiet selfdrive/ui/translations/*.ts; then
111+
echo "No translation updates detected."
112+
exit 0
113+
fi
114+
115+
git fetch --unshallow origin ${{ needs.get_branch.outputs.branch }}
116+
git checkout ${{ needs.get_branch.outputs.branch }}
117+
118+
git add selfdrive/ui/translations/*.ts
119+
git commit --amend --no-edit
120+
git push --force origin ${{ needs.get_branch.outputs.branch }}
121+
122+
build_and_push:
123+
needs:
124+
- get_branch
125+
- translate
126+
if: always()
127+
runs-on: [self-hosted, c3x]
128+
permissions:
129+
contents: write
130+
steps:
131+
- name: Configure Git Identity
132+
run: |
133+
git config --global user.name "${{ github.actor }}"
134+
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
135+
136+
- name: Update Repository
137+
run: |
138+
cd $BUILD_DIR
139+
140+
git remote set-url origin https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/FrogAi/FrogPilot.git
141+
142+
if [ "${{ github.event.inputs.update_translations }}" = "true" ]; then
143+
git fetch origin ${{ needs.get_branch.outputs.branch }}
144+
git reset --hard origin/${{ needs.get_branch.outputs.branch }}
145+
git pull origin ${{ needs.get_branch.outputs.branch }}
146+
fi
147+
148+
- name: Take Ownership of Build
149+
run: |
150+
sudo chown -R $(whoami):$(whoami) $BUILD_DIR
151+
152+
- name: Finalize Build
153+
run: |
154+
cd $BUILD_DIR
155+
156+
rm -f .clang-tidy
157+
rm -f .dockerignore
158+
rm -f .editorconfig
159+
rm -f .gitattributes
160+
rm -f .gitmodules
161+
rm -f .lfsconfig
162+
rm -f .overlay_init
163+
rm -f .pre-commit-config.yaml
164+
rm -f .sconsign.dblite
165+
rm -f codecov.yml
166+
rm -f conftest.py
167+
rm -f poetry.lock
168+
rm -f pyproject.toml
169+
rm -f teleoprtc
170+
rm -f tinygrad
171+
rm -f Dockerfile.openpilot
172+
rm -f Dockerfile.openpilot_base
173+
rm -f Jenkinsfile
174+
175+
rm -f panda/board/obj/.placeholder
176+
rm -f panda/board/obj/bootstub.panda.bin
177+
rm -f panda/board/obj/bootstub.panda.elf
178+
rm -f panda/board/obj/bootstub.panda_h7.bin
179+
rm -f panda/board/obj/bootstub.panda_h7.elf
180+
rm -f panda/board/obj/panda.bin
181+
rm -f panda/board/obj/panda.elf
182+
rm -f panda/board/obj/panda_h7.bin
183+
rm -f panda/board/obj/panda_h7.elf
184+
rm -f panda/board/obj/version
185+
186+
find . -name '*.a' -delete
187+
find . -name '*.cc' -delete
188+
find . -name '*.o' -delete
189+
find . -name '*.onnx' -delete
190+
find . -name '*.os' -delete
191+
find . -name '*.pyc' -delete
192+
find . -name 'moc_*' -delete
193+
find . -name '__pycache__' -exec rm -rf {} +
194+
195+
find . -name '*.h' | while read -r header; do
196+
if [[ "$header" != *"common/version.h" && "$header" != *"system/camerad/sensors/"* ]]; then
197+
rm -f "$header"
198+
fi
199+
done
200+
201+
rm -rf .devcontainer/
202+
rm -rf .vscode/
203+
rm -rf body/
204+
rm -rf opendbc/generator/
205+
rm -rf release/
206+
rm -rf scripts/
207+
rm -rf site_scons/
208+
rm -rf teleoprtc_repo/
209+
210+
find .github -mindepth 1 -maxdepth 1 ! -name 'workflows' -exec rm -rf {} +
211+
212+
find .github/workflows -mindepth 1 ! \( \
213+
-type f \( \
214+
-name 'compile_frogpilot.yaml' -o \
215+
-name 'review_pull_request.yaml' -o \
216+
-name 'schedule_update.yaml' -o \
217+
-name 'update_pr_branch.yaml' -o \
218+
-name 'update_release_branch.yaml' \
219+
\) \
220+
\) -exec rm -rf {} +
221+
222+
find panda/board/jungle -type f ! -name '__init__.py' -delete
223+
find panda/board/jungle -type d -empty -delete
224+
225+
find third_party/ -name '*x86*' -exec rm -rf {} +
226+
find third_party/ -name '*Darwin*' -exec rm -rf {} +
227+
228+
find tools/ -mindepth 1 -maxdepth 1 ! \( -name '__init__.py' -o -name 'bodyteleop' -o -name 'lib' \) -exec rm -rf {} +
229+
230+
find . -name 'SConstruct' -delete
231+
find . -name 'SConscript' -delete
232+
233+
find . -type d \( -iname "debug" -o -iname "test" -o -iname "tests" \) -exec rm -rf {} +
234+
find . -type d -empty ! -path "./.git*" -delete
235+
find . -type f -regex '.*matlab.*\.md' -delete
236+
237+
touch prebuilt
238+
239+
if [ "${{ github.event.inputs.not_vetted }}" = "true" ]; then
240+
touch not_vetted
241+
fi
242+
243+
- name: Commit Build
244+
run: |
245+
cd $BUILD_DIR
246+
247+
git add -f .
248+
git commit -m "Compile FrogPilot"
249+
git push --force origin HEAD
250+
251+
if [ "${{ github.event.inputs.publish_frogpilot }}" = "true" ]; then
252+
git push --force origin HEAD:"FrogPilot"
253+
fi
254+
255+
if [ "${{ github.event.inputs.publish_staging }}" = "true" ]; then
256+
git push --force origin HEAD:"FrogPilot-Staging"
257+
fi
258+
259+
if [ "${{ github.event.inputs.publish_testing }}" = "true" ]; then
260+
git push --force origin HEAD:"FrogPilot-Testing"
261+
fi
262+
263+
if [ -n "${{ github.event.inputs.publish_custom_branch }}" ]; then
264+
git push --force origin HEAD:"${{ github.event.inputs.publish_custom_branch }}"
265+
fi
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PR Review
1+
name: Review Pull Request
22

33
on:
44
pull_request_target:
@@ -13,24 +13,24 @@ jobs:
1313
pr_check:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- name: Exit if PR opened by FrogAi
17-
if: ${{ github.actor == 'FrogAi' }}
16+
- name: Exit If PR Opened by FrogAi
17+
if: ${{ github.actor == "FrogAi" }}
1818
run: |
1919
echo "PR opened or reopened by FrogAi. No action needed."
2020
exit 0
2121
22-
- name: Close PR if target branch is invalid
23-
if: ${{ github.base_ref != 'MAKE-PRS-HERE' }}
22+
- name: Close PR for Invalid Target Branch
23+
if: ${{ github.base_ref != "MAKE-PRS-HERE" }}
2424
run: |
2525
gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
2626
-f body="Please submit your pull request to the \"MAKE-PRS-HERE\" branch."
2727
2828
gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} \
2929
-X PATCH \
30-
-f state='closed'
30+
-f state="closed"
3131
32-
- name: Thank for PR if target branch is valid
33-
if: ${{ github.base_ref == 'MAKE-PRS-HERE' }}
32+
- name: Acknowledge PR for Valid Target Branch
33+
if: ${{ github.base_ref == "MAKE-PRS-HERE" }}
3434
run: |
3535
gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
3636
-f body="Thank you for your PR! If you're not already in the FrogPilot Discord, [feel free to join](https://discord.FrogPilot.download) and let me know you've opened a PR!"

.github/workflows/schedule_update.yaml

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,44 @@ jobs:
1414
schedule-update:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- name: Checkout repository
17+
- name: Configure Git Identity
18+
run: |
19+
git config --global user.name "${{ github.actor }}"
20+
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
21+
22+
- name: Checkout ${{ env.BRANCH }}
1823
uses: actions/checkout@v3
1924
with:
2025
ref: ${{ env.BRANCH }}
2126
fetch-depth: 2
2227

23-
- name: Switch to target branch
28+
- name: Schedule Update for ${{ github.event.inputs.scheduled_date }}
2429
run: |
25-
git checkout ${{ env.BRANCH }} || git checkout -b ${{ env.BRANCH }}
30+
echo "${{ github.event.inputs.scheduled_date }}" > .github/update_date
31+
git add .github/update_date
2632
27-
- name: Capture last commit details
33+
- name: Get Target Commit (Second Most Recent)
34+
id: get_target
2835
run: |
29-
last_date=$(git log -1 --format="%cI")
30-
last_message=$(git log -1 --format="%B")
36+
TARGET_COMMIT=$(git rev-parse HEAD~1)
3137
32-
echo "LAST_DATE=$last_date" >> $GITHUB_ENV
33-
echo "LAST_MESSAGE<<EOF" >> $GITHUB_ENV
34-
echo "$last_message" >> $GITHUB_ENV
35-
echo "EOF" >> $GITHUB_ENV
38+
AUTHOR_DATE=$(git show -s --format=%aD "$TARGET_COMMIT")
39+
COMMITTER_DATE=$(git show -s --format=%cD "$TARGET_COMMIT")
3640
37-
- name: Create update date file
38-
run: echo "${{ github.event.inputs.scheduled_date }}" > .github/update_date
41+
echo "AUTHOR_DATE=$AUTHOR_DATE" >> $GITHUB_ENV
42+
echo "COMMITTER_DATE=$COMMITTER_DATE" >> $GITHUB_ENV
43+
echo "TARGET_COMMIT=$TARGET_COMMIT" >> $GITHUB_ENV
3944
40-
- name: Commit update date file
41-
run: |
42-
git config --global user.name "${{ github.actor }}"
43-
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
45+
- name: Create Fixup Commit for ${{ env.TARGET_COMMIT }}
46+
run: git commit --fixup="${{ env.TARGET_COMMIT }}"
4447

45-
git add .github/update_date
46-
git commit -m "Scheduled update for ${{ github.event.inputs.scheduled_date }}"
47-
48-
- name: Squash update date file commit
48+
- name: Autosquash Fixup into Target Commit
4949
run: |
50-
git reset --soft HEAD~1
50+
GIT_SEQUENCE_EDITOR=: git rebase --autosquash -i HEAD~3
5151
52-
GIT_COMMITTER_DATE="${{ env.LAST_DATE }}" git commit --amend -m "${{ env.LAST_MESSAGE }}"
52+
- name: Restore Timestamps on Final Two Commits
53+
run: |
54+
git rebase --exec "GIT_COMMITTER_DATE='${{ env.COMMITTER_DATE }}' git commit --amend --no-edit --date='${{ env.AUTHOR_DATE }}'" HEAD~2
5355
54-
git push origin HEAD --force
56+
- name: Push Updated ${{ env.BRANCH }} Branch
57+
run: git push origin "${{ env.BRANCH }}" --force-with-lease

0 commit comments

Comments
 (0)