mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 17:23:52 +08:00
* cleanup is_enumerated, rename comms and init spi * big comms refactor, building now * misra fixes * more fixes * misra try 3 * cleanup * this belongs in a separate PR * remove unneccesary file * revert llspi changes * llspi misra fix * enable SPI on F4 and setup gpio * duh * wip: spi comms * more spi wip * dynamic sector erasing * Revert "dynamic sector erasing" This reverts commit fce1215a2ede45e5e2a0e97ca23a86c1d8bfa94a. * more sectors to be erased * debugging * woah, this works * cleanup on the panda side * add sync and checksum checks, and fix recovery on errors * this seems relatively stable * add retrying * this is stabler * some endianness and endpoint fixes * builds * revert that * add that back * checksum start * start splitting up driver * spi behind flag * cleanup test * bump up timeout Co-authored-by: Comma Device <device@comma.ai> Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
129 lines
4.0 KiB
YAML
129 lines
4.0 KiB
YAML
name: tests
|
|
on: [push, 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/openpilot/panda -w /tmp/openpilot/panda --rm panda /bin/bash -c
|
|
PERSIST: docker run -v $GITHUB_WORKSPACE:/tmp/openpilot/panda -w /tmp/openpilot/panda --name panda 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 .
|
|
|
|
jobs:
|
|
docker_push:
|
|
name: docker push
|
|
runs-on: ubuntu-20.04
|
|
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-20.04
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Build Docker image
|
|
run: eval "$BUILD"
|
|
- name: Test python package installer
|
|
run: ${{ env.RUN }} "cd /tmp/openpilot/panda && python setup.py install"
|
|
- name: Build panda + pedal images and bootstub
|
|
run: ${{ env.RUN }} "cd /tmp/openpilot/panda && scons -j4"
|
|
- name: Build panda with SPI support
|
|
run: ${{ env.RUN }} "cd /tmp/openpilot/panda && ENABLE_SPI=1 scons -j4"
|
|
|
|
unit_tests:
|
|
name: unit tests
|
|
runs-on: ubuntu-20.04
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Build Docker image
|
|
run: eval "$BUILD"
|
|
- name: Test pack/unpack for USB protocol
|
|
run: ${{ env.RUN }} "cd /tmp/openpilot/panda/tests/usbprotocol &&
|
|
python -m unittest discover ."
|
|
|
|
safety:
|
|
name: safety
|
|
runs-on: ubuntu-20.04
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Build Docker image
|
|
run: eval "$BUILD"
|
|
- name: Run safety tests
|
|
timeout-minutes: 4
|
|
run: |
|
|
${{ env.RUN }} "cd /tmp/openpilot && \
|
|
scons -c && \
|
|
scons -j$(nproc) opendbc/ cereal/ && \
|
|
cd panda/tests/safety && \
|
|
./test.sh"
|
|
|
|
safety_replay:
|
|
name: safety replay
|
|
runs-on: ubuntu-20.04
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Build Docker image
|
|
run: eval "$BUILD"
|
|
- name: Run safety replay
|
|
run: ${{ env.RUN }} "cd tests/safety_replay &&
|
|
scons -u --test .. &&
|
|
./test_safety_replay.py"
|
|
|
|
misra:
|
|
name: misra c2012
|
|
runs-on: ubuntu-20.04
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Build Docker image
|
|
run: eval "$BUILD"
|
|
- name: Run Misra C 2012 analysis
|
|
timeout-minutes: 4
|
|
run: ${{ env.PERSIST }} "cd tests/misra && ./test_misra.sh"
|
|
- name: Copy analysis outputs
|
|
run: docker cp panda:/tmp/misra /tmp
|
|
- uses: actions/upload-artifact@v2
|
|
if: always()
|
|
with:
|
|
name: cppcheck_output
|
|
path: /tmp/misra/cppcheck_*_output.txt
|
|
- uses: actions/upload-artifact@v2
|
|
if: always()
|
|
with:
|
|
name: misra_output
|
|
path: /tmp/misra/misra_*_output.txt
|
|
- run: docker rm panda
|
|
if: always()
|
|
|
|
python_linter:
|
|
name: python linter
|
|
runs-on: ubuntu-20.04
|
|
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"
|
|
|
|
|