-
Notifications
You must be signed in to change notification settings - Fork 9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into opendbc_new_api
- Loading branch information
Showing
471 changed files
with
11,108 additions
and
17,454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
name: weekly CI test report | ||
on: | ||
schedule: | ||
- cron: '37 9 * * 1' # 9:37AM UTC -> 2:37AM PST every monday | ||
workflow_dispatch: | ||
inputs: | ||
ci_runs: | ||
description: 'The amount of runs to trigger in CI test report' | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
CI_RUNS: ${{ github.event.inputs.ci_runs || '50' }} | ||
|
||
jobs: | ||
setup: | ||
if: github.repository == 'commaai/openpilot' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
ci_runs: ${{ steps.ci_runs_setup.outputs.matrix }} | ||
steps: | ||
- id: ci_runs_setup | ||
name: CI_RUNS=${{ env.CI_RUNS }} | ||
run: | | ||
matrix=$(python3 -c "import json; print(json.dumps({ 'run_number' : list(range(${{ env.CI_RUNS }})) }))") | ||
echo "matrix=$matrix" >> $GITHUB_OUTPUT | ||
ci_matrix_run: | ||
needs: [ setup ] | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{fromJSON(needs.setup.outputs.ci_runs)}} | ||
uses: commaai/openpilot/.github/workflows/ci_weekly_run.yaml@master | ||
with: | ||
run_number: ${{ matrix.run_number }} | ||
|
||
report: | ||
needs: [ci_matrix_run] | ||
runs-on: ubuntu-latest | ||
if: always() | ||
steps: | ||
- name: Get job results | ||
uses: actions/github-script@v7 | ||
id: get-job-results | ||
with: | ||
script: | | ||
const jobs = await github | ||
.paginate("GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt}/jobs", { | ||
owner: "commaai", | ||
repo: "${{ github.event.repository.name }}", | ||
run_id: "${{ github.run_id }}", | ||
attempt: "${{ github.run_attempt }}", | ||
}) | ||
var report = {} | ||
jobs.slice(1, jobs.length-1).forEach(job => { | ||
if (job.conclusion === "skipped") return; | ||
const jobName = job.name.split(" / ")[2]; | ||
const runRegex = /\((.*?)\)/; | ||
const run = job.name.match(runRegex)[1]; | ||
report[jobName] = report[jobName] || { successes: [], failures: [], cancelled: [] }; | ||
switch (job.conclusion) { | ||
case "success": | ||
report[jobName].successes.push({ "run_number": run, "link": job.html_url}); break; | ||
case "failure": | ||
report[jobName].failures.push({ "run_number": run, "link": job.html_url }); break; | ||
case "cancelled": | ||
report[jobName].cancelled.push({ "run_number": run, "link": job.html_url }); break; | ||
} | ||
}); | ||
return JSON.stringify({"jobs": report}); | ||
- name: Add job results to summary | ||
env: | ||
JOB_RESULTS: ${{ fromJSON(steps.get-job-results.outputs.result) }} | ||
run: | | ||
cat <<EOF >> template.html | ||
<table> | ||
<thead> | ||
<tr> | ||
<th></th> | ||
<th>Job</th> | ||
<th>✅ Passing</th> | ||
<th>❌ Failure Details</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for key in jobs.keys() %}<tr> | ||
<td>{% for i in range(5) %}{% if i+1 <= (5 * jobs[key]["successes"]|length // ${{ env.CI_RUNS }}) %}🟩{% else %}🟥{% endif %}{% endfor%}</td> | ||
<td>{{ key }}</td> | ||
<td>{{ 100 * jobs[key]["successes"]|length // ${{ env.CI_RUNS }} }}%</td> | ||
<td>{% if jobs[key]["failures"]|length > 0 %}<details>{% for failure in jobs[key]["failures"] %}<a href="{{ failure['link'] }}">Log for run #{{ failure['run_number'] }}</a><br>{% endfor %}</details>{% else %}{% endif %}</td> | ||
</td> | ||
</tr>{% endfor %} | ||
</table> | ||
EOF | ||
pip install jinja2-cli | ||
echo $JOB_RESULTS | jinja2 template.html > report.html | ||
echo "# CI Test Report - ${{ env.CI_RUNS }} Runs" >> $GITHUB_STEP_SUMMARY | ||
cat report.html >> $GITHUB_STEP_SUMMARY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: weekly CI test run | ||
on: | ||
workflow_call: | ||
inputs: | ||
run_number: | ||
required: true | ||
type: string | ||
|
||
concurrency: | ||
group: ci-run-${{ inputs.run_number }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
selfdrive_tests: | ||
uses: commaai/openpilot/.github/workflows/selfdrive_tests.yaml@master | ||
with: | ||
run_number: ${{ inputs.run_number }} | ||
tools_tests: | ||
uses: commaai/openpilot/.github/workflows/tools_tests.yaml@master | ||
with: | ||
run_number: ${{ inputs.run_number }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: jenkins scan | ||
|
||
on: | ||
issue_comment: | ||
types: [created, edited] | ||
|
||
jobs: | ||
# TODO: gc old branches in a separate job in this workflow | ||
scan-comments: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.issue.pull_request }} | ||
steps: | ||
- name: Check for trigger phrase | ||
id: check_comment | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const triggerPhrase = "trigger-jenkins"; | ||
const comment = context.payload.comment.body; | ||
const commenter = context.payload.comment.user.login; | ||
const { data: permissions } = await github.rest.repos.getCollaboratorPermissionLevel({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
username: commenter | ||
}); | ||
const hasWriteAccess = permissions.permission === 'write' || permissions.permission === 'admin'; | ||
return (hasWriteAccess && comment.includes(triggerPhrase)); | ||
result-encoding: json | ||
|
||
- name: Checkout repository | ||
if: steps.check_comment.outputs.result == 'true' | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: refs/pull/${{ github.event.issue.number }}/head | ||
|
||
- name: Push to tmp-jenkins branch | ||
if: steps.check_comment.outputs.result == 'true' | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git checkout -b tmp-jenkins-${{ github.event.issue.number }} | ||
GIT_LFS_SKIP_PUSH=1 git push -f origin tmp-jenkins-${{ github.event.issue.number }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.