From cf55992c2664080084500d96222bdec9d10e222a Mon Sep 17 00:00:00 2001 From: DevTekVE Date: Sat, 16 Nov 2024 16:24:47 +0100 Subject: [PATCH] CI: sunnypilot configuration (#447) * initial updates to the actions to run for sp * ignore license file * more updates * undoing some of the changes because I was blocking the runs on * allowing the submodule check as well * Allowing macos builds * test adding cache key * don't attempt build_release for selfdrive for the time being. * Blocking macos builds as well since they have a 10x miltiplier for GH aciton minutes, waaaay too much! * lol nice typo codespell * change ref commit id to check if replay passes --- .github/workflows/auto_pr_review.yaml | 10 +++++----- .github/workflows/badges.yaml | 4 ++-- .github/workflows/ci_weekly_report.yaml | 4 ++-- .github/workflows/ci_weekly_run.yaml | 4 ++-- .github/workflows/docs.yaml | 6 +++--- .github/workflows/prebuilt.yaml | 2 +- .github/workflows/release.yaml | 2 +- .github/workflows/repo-maintenance.yaml | 2 +- .github/workflows/selfdrive_tests.yaml | 11 +++++++++-- .github/workflows/stale.yaml | 2 +- .github/workflows/tools_tests.yaml | 1 + .github/workflows/ui_preview.yaml | 3 ++- scripts/lint/lint.sh | 2 +- selfdrive/test/process_replay/ref_commit | 2 +- 14 files changed, 32 insertions(+), 23 deletions(-) diff --git a/.github/workflows/auto_pr_review.yaml b/.github/workflows/auto_pr_review.yaml index eaaca5606..324912a7d 100644 --- a/.github/workflows/auto_pr_review.yaml +++ b/.github/workflows/auto_pr_review.yaml @@ -24,7 +24,7 @@ jobs: # Check PR target branch - name: check branch uses: Vankka/pr-target-branch-action@def32ec9d93514138d6ac0132ee62e120a72aed5 - if: github.repository == 'commaai/openpilot' + if: github.repository == 'sunnypilot/sunnypilot' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -37,17 +37,17 @@ jobs: # Welcome comment - name: "First timers PR" uses: actions/first-interaction@v1 - if: github.event.pull_request.head.repo.full_name != 'commaai/openpilot' + if: github.event.pull_request.head.repo.full_name != 'sunnypilot/sunnypilot' with: repo-token: ${{ secrets.GITHUB_TOKEN }} pr-message: | Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following: * Convert your PR to a draft unless it's ready to review - * Read the [contributing docs](https://github.com/commaai/openpilot/blob/master/docs/CONTRIBUTING.md) + * Read the [contributing docs](https://github.com/sunnypilot/sunnypilot/blob/master/docs/CONTRIBUTING.md) * Before marking as "ready for review", ensure: * the goal is clearly stated in the description * all the tests are passing - * the change is [something we merge](https://github.com/commaai/openpilot/blob/master/docs/CONTRIBUTING.md#what-gets-merged) + * the change is [something we merge](https://github.com/sunnypilot/sunnypilot/blob/master/docs/CONTRIBUTING.md#what-gets-merged) * include a route or your device' dongle ID if relevant - + diff --git a/.github/workflows/badges.yaml b/.github/workflows/badges.yaml index 63ee736dc..505148bea 100644 --- a/.github/workflows/badges.yaml +++ b/.github/workflows/badges.yaml @@ -13,7 +13,7 @@ jobs: badges: name: create badges runs-on: ubuntu-latest - if: github.repository == 'commaai/openpilot' + if: github.repository == 'sunnypilot/sunnypilot' permissions: contents: write steps: @@ -29,7 +29,7 @@ jobs: git checkout --orphan badges git rm -rf --cached . - git config user.email "badge-researcher@comma.ai" + git config user.email "badge-researcher@sunnypilot.ai" git config user.name "Badge Researcher" git add translation_badge.svg diff --git a/.github/workflows/ci_weekly_report.yaml b/.github/workflows/ci_weekly_report.yaml index 9821283cb..b96a5a56a 100644 --- a/.github/workflows/ci_weekly_report.yaml +++ b/.github/workflows/ci_weekly_report.yaml @@ -15,7 +15,7 @@ env: jobs: setup: - if: github.repository == 'commaai/openpilot' + if: github.repository == 'sunnypilot/sunnypilot' runs-on: ubuntu-latest outputs: ci_runs: ${{ steps.ci_runs_setup.outputs.matrix }} @@ -31,7 +31,7 @@ jobs: strategy: fail-fast: false matrix: ${{fromJSON(needs.setup.outputs.ci_runs)}} - uses: commaai/openpilot/.github/workflows/ci_weekly_run.yaml@master + uses: sunnypilot/sunnypilot/.github/workflows/ci_weekly_run.yaml@master with: run_number: ${{ matrix.run_number }} diff --git a/.github/workflows/ci_weekly_run.yaml b/.github/workflows/ci_weekly_run.yaml index c3ce8c42d..98bffd896 100644 --- a/.github/workflows/ci_weekly_run.yaml +++ b/.github/workflows/ci_weekly_run.yaml @@ -12,10 +12,10 @@ concurrency: jobs: selfdrive_tests: - uses: commaai/openpilot/.github/workflows/selfdrive_tests.yaml@master + uses: sunnypilot/sunnypilot/.github/workflows/selfdrive_tests.yaml@master with: run_number: ${{ inputs.run_number }} tools_tests: - uses: commaai/openpilot/.github/workflows/tools_tests.yaml@master + uses: sunnypilot/sunnypilot/.github/workflows/tools_tests.yaml@master with: run_number: ${{ inputs.run_number }} diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 26b60ffec..317b69f8b 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -34,13 +34,13 @@ jobs: # Push to docs.comma.ai - uses: actions/checkout@v4 - if: github.ref == 'refs/heads/master' && github.repository == 'commaai/openpilot' + if: github.ref == 'refs/heads/master' && github.repository == 'sunnypilot/sunnypilot' with: path: openpilot-docs ssh-key: ${{ secrets.OPENPILOT_DOCS_KEY }} - repository: commaai/openpilot-docs + repository: sunnypilot/sunnypilot-docs - name: Push - if: github.ref == 'refs/heads/master' && github.repository == 'commaai/openpilot' + if: github.ref == 'refs/heads/master' && github.repository == 'sunnypilot/sunnypilot' run: | set -x diff --git a/.github/workflows/prebuilt.yaml b/.github/workflows/prebuilt.yaml index d8963ec89..61e3f3bc4 100644 --- a/.github/workflows/prebuilt.yaml +++ b/.github/workflows/prebuilt.yaml @@ -12,7 +12,7 @@ jobs: build_prebuilt: name: build prebuilt runs-on: ubuntu-latest - if: github.repository == 'commaai/openpilot' + if: github.repository == 'sunnypilot/sunnypilot' env: PUSH_IMAGE: true permissions: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c86c04477..2dfa9d029 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -13,7 +13,7 @@ jobs: container: image: ghcr.io/commaai/openpilot-base:latest runs-on: ubuntu-latest - if: github.repository == 'commaai/openpilot' + if: github.repository == 'sunnypilot/sunnypilot' permissions: checks: read contents: write diff --git a/.github/workflows/repo-maintenance.yaml b/.github/workflows/repo-maintenance.yaml index c724c00c5..424c21c36 100644 --- a/.github/workflows/repo-maintenance.yaml +++ b/.github/workflows/repo-maintenance.yaml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest container: image: ghcr.io/commaai/openpilot-base:latest - if: github.repository == 'commaai/openpilot' + if: github.repository == 'sunnypilot/sunnypilot' steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index fc59d2568..5d55d27a5 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -4,6 +4,7 @@ on: push: branches: - master + - master-new pull_request: workflow_dispatch: workflow_call: @@ -31,6 +32,7 @@ env: jobs: build_release: + if: github.repository == 'commaai/openpilot' # build_release blocked for the time being to only comma as we may have a different process. name: build release runs-on: ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || @@ -52,7 +54,7 @@ jobs: run: TARGET_DIR=$STRIPPED_DIR release/build_devel.sh - uses: ./.github/workflows/setup-with-retry - name: Check submodules - if: github.repository == 'commaai/openpilot' + if: github.repository == 'sunnypilot/sunnypilot' timeout-minutes: 3 run: release/check-submodules.sh - name: Build openpilot and run checks @@ -101,8 +103,11 @@ jobs: timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 15 || 30) }} # allow more time when we missed the scons cache build_mac: + if: github.repository == 'commaai/openpilot' # Blocking macos builds as well since they have a 10x miltiplier for GH action minutes, waaaay too much! name: build macOS - runs-on: namespace-profile-macos-8x14 + 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@v4 with: @@ -111,6 +116,7 @@ jobs: uses: ./.github/workflows/auto-cache with: path: ~/Library/Caches/Homebrew + key: build_macos_${{ hashFiles('.github/workflows/selfdrive_tests.yaml') }} - name: Install dependencies run: ./tools/mac_setup.sh env: @@ -122,6 +128,7 @@ jobs: uses: ./.github/workflows/auto-cache with: path: /tmp/scons_cache + key: build_macos_${{ hashFiles('.github/workflows/selfdrive_tests.yaml') }} - name: Building openpilot run: . .venv/bin/activate && scons -j$(nproc) diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index d0dead512..cc2981395 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -20,7 +20,7 @@ jobs: stale-pr-message: 'This PR has had no activity for ${{ env.DAYS_BEFORE_PR_STALE }} days. It will be automatically closed in ${{ env.DAYS_BEFORE_PR_CLOSE }} days if there is no activity.' close-pr-message: 'This PR has been automatically closed due to inactivity. Feel free to re-open once activity resumes.' stale-pr-label: stale - delete-branch: ${{ github.event.pull_request.head.repo.full_name == 'commaai/openpilot' }} # only delete branches on the main repo + delete-branch: ${{ github.event.pull_request.head.repo.full_name == 'sunnypilot/sunnypilot' }} # only delete branches on the main repo exempt-pr-labels: "ignore stale,needs testing" # if wip or it needs testing from the community, don't mark as stale days-before-pr-stale: ${{ env.DAYS_BEFORE_PR_STALE }} days-before-pr-close: ${{ env.DAYS_BEFORE_PR_CLOSE }} diff --git a/.github/workflows/tools_tests.yaml b/.github/workflows/tools_tests.yaml index 493671051..abbbe491c 100644 --- a/.github/workflows/tools_tests.yaml +++ b/.github/workflows/tools_tests.yaml @@ -4,6 +4,7 @@ on: push: branches: - master + - master-new pull_request: workflow_call: inputs: diff --git a/.github/workflows/ui_preview.yaml b/.github/workflows/ui_preview.yaml index f9d7feba8..722ff3575 100644 --- a/.github/workflows/ui_preview.yaml +++ b/.github/workflows/ui_preview.yaml @@ -3,6 +3,7 @@ on: push: branches: - master + - master-new pull_request_target: types: [assigned, opened, synchronize, reopened, edited] branches: @@ -19,7 +20,7 @@ env: jobs: preview: - if: github.repository == 'commaai/openpilot' + if: github.repository == 'sunnypilot/sunnypilot' name: preview runs-on: ubuntu-latest timeout-minutes: 20 diff --git a/scripts/lint/lint.sh b/scripts/lint/lint.sh index 578c63cd1..44622922b 100755 --- a/scripts/lint/lint.sh +++ b/scripts/lint/lint.sh @@ -13,7 +13,7 @@ cd $ROOT FAILED=0 -IGNORED_FILES="uv\.lock|docs\/CARS.md" +IGNORED_FILES="uv\.lock|docs\/CARS.md|LICENSE\.md" IGNORED_DIRS="^third_party.*|^msgq.*|^msgq_repo.*|^opendbc.*|^opendbc_repo.*|^cereal.*|^panda.*|^rednose.*|^rednose_repo.*|^tinygrad.*|^tinygrad_repo.*|^teleoprtc.*|^teleoprtc_repo.*" function run() { diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index c779902d6..19ea61cb0 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -2fc2e865ab77fd8145feab86d454f2111c5d9871 +dd0a40182707975c94a40d19198cd60c88735199