Carrot2-v9
This commit is contained in:
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
name: drivers
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build_socketcan:
|
||||
name: socketcan build
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get install -y dkms gcc linux-headers-$(uname -r) make
|
||||
- name: Build socketcan driver
|
||||
run: |
|
||||
cd drivers/linux
|
||||
make link
|
||||
make build
|
||||
|
||||
# FIXME: install doesn't work sometimes in GH Actions
|
||||
#make install
|
||||
- name: Print make log
|
||||
if: always()
|
||||
continue-on-error: true
|
||||
run: cat /var/lib/dkms/panda/*/build/make.log
|
||||
+45
@@ -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 }}
|
||||
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
name: repo
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 15 1 * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
pre-commit-autoupdate:
|
||||
name: pre-commit autoupdate
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/commaai/panda:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: pre-commit autoupdate
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
pre-commit autoupdate
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@5b4a9f6a9e2af26e5f02351490b90d01eb8ec1e5
|
||||
with:
|
||||
token: ${{ secrets.ACTIONS_CREATE_PR_PAT }}
|
||||
commit-message: Update pre-commit hook versions
|
||||
title: 'pre-commit: autoupdate hooks'
|
||||
branch: pre-commit-updates
|
||||
base: master
|
||||
delete-branch: true
|
||||
Vendored
+111
@@ -0,0 +1,111 @@
|
||||
name: tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/master' && github.ref || github.run_id }}-${{ github.event_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
RUN: docker run -v ${{ github.workspace }}:/tmp/pythonpath/panda -w /tmp/pythonpath/panda --rm panda /bin/bash -c
|
||||
BUILD: |
|
||||
export DOCKER_BUILDKIT=1
|
||||
docker build --pull --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from ghcr.io/commaai/panda:latest -t panda -f Dockerfile .
|
||||
|
||||
PYTHONWARNINGS: "error"
|
||||
|
||||
jobs:
|
||||
docker_push:
|
||||
name: docker push
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/panda'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build Docker image
|
||||
timeout-minutes: 11
|
||||
run: eval "$BUILD"
|
||||
- name: Login to dockerhub
|
||||
run: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Tag image
|
||||
run: docker tag panda ghcr.io/commaai/panda:latest
|
||||
- name: Push image
|
||||
run: docker push ghcr.io/commaai/panda:latest
|
||||
|
||||
build:
|
||||
name: build
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build Docker image
|
||||
run: eval "$BUILD"
|
||||
- name: Test python package installer
|
||||
run: ${{ env.RUN }} "python3 setup.py install"
|
||||
- name: Build panda images and bootstub
|
||||
run: ${{ env.RUN }} "scons -j4"
|
||||
- name: Build panda with SPI support
|
||||
run: ${{ env.RUN }} "ENABLE_SPI=1 scons -j4"
|
||||
- name: Build with UBSan
|
||||
run: ${{ env.RUN }} "scons -j4 --ubsan"
|
||||
- name: Build jungle firmware with FINAL_PROVISIONING support
|
||||
run: ${{ env.RUN }} "FINAL_PROVISIONING=1 scons -j4 board/jungle"
|
||||
- name: Build panda in release mode
|
||||
run: ${{ env.RUN }} "CERT=certs/debug RELEASE=1 scons -j4"
|
||||
|
||||
unit_tests:
|
||||
name: unit tests
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build Docker image
|
||||
run: eval "$BUILD"
|
||||
- name: Build panda
|
||||
run: $RUN "scons -j4"
|
||||
- name: Test communication protocols
|
||||
run: $RUN "cd tests/usbprotocol && ./test.sh"
|
||||
|
||||
misra_linter:
|
||||
name: MISRA C:2012 Linter
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build Docker image
|
||||
run: eval "$BUILD"
|
||||
- name: Build FW
|
||||
run: ${{ env.RUN }} "scons -j$(nproc)"
|
||||
- name: Run MISRA C:2012 analysis
|
||||
timeout-minutes: 2
|
||||
run: ${{ env.RUN }} "cd tests/misra && ./test_misra.sh"
|
||||
|
||||
misra_mutation:
|
||||
name: MISRA C:2012 Mutation
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build Docker image
|
||||
run: eval "$BUILD"
|
||||
- name: Build FW
|
||||
run: ${{ env.RUN }} "scons -j$(nproc)"
|
||||
- name: MISRA mutation tests
|
||||
timeout-minutes: 5
|
||||
run: ${{ env.RUN }} "cd tests/misra && pytest -n8 test_mutation.py"
|
||||
|
||||
static_analysis:
|
||||
name: static analysis
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build Docker image
|
||||
run: eval "$BUILD"
|
||||
- name: Run static analysis
|
||||
timeout-minutes: 3
|
||||
run: ${{ env.RUN }} "pre-commit run --all"
|
||||
Reference in New Issue
Block a user