-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2c720b
commit 55b79b4
Showing
13 changed files
with
227 additions
and
961 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,155 @@ | ||
name: panda tests | ||
on: [push, pull_request] | ||
|
||
env: | ||
RUN: docker run --rm panda /bin/sh -c | ||
PERSIST: docker run --name panda panda /bin/sh -c | ||
LOAD: docker load -i panda.tar.gz/panda.tar.gz | ||
|
||
jobs: | ||
docker_build: | ||
name: docker build | ||
runs-on: ubuntu-16.04 | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build docker image | ||
run: | | ||
docker pull $(grep -ioP '(?<=^from)\s+\S+' Dockerfile.panda) || true | ||
docker pull docker.io/commaai/panda:latest || true | ||
docker build --cache-from docker.io/commaai/panda:latest -t panda -f Dockerfile.panda . | ||
docker save panda:latest | gzip > panda.tar.gz | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: panda.tar.gz | ||
path: panda.tar.gz | ||
|
||
docker_push: | ||
name: docker push | ||
runs-on: ubuntu-16.04 | ||
timeout-minutes: 10 | ||
needs: docker_build | ||
#if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/panda' | ||
steps: | ||
- uses: actions/download-artifact@v1 | ||
with: | ||
name: panda.tar.gz | ||
- name: Load image | ||
run: $LOAD | ||
- name: Login to dockerhub | ||
run: docker login -u wmelching -p ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Tag image | ||
run: docker tag panda docker.io/commaai/panda:latest | ||
- name: Push image | ||
run: docker push docker.io/commaai/panda:latest | ||
|
||
build: | ||
name: build | ||
runs-on: ubuntu-16.04 | ||
timeout-minutes: 30 | ||
needs: docker_build | ||
steps: | ||
- uses: actions/download-artifact@v1 | ||
with: | ||
name: panda.tar.gz | ||
- name: Load image | ||
run: $LOAD | ||
- name: Test python package installer | ||
run: $RUN "cd /tmp/openpilot/panda && python setup.py install" | ||
- name: Build panda STM image | ||
run: $RUN "cd /tmp/openpilot/panda/board && make bin" | ||
- name: Build panda STM bootstub image | ||
run: $RUN "cd /tmp/openpilot/panda/board && make obj/bootstub.panda.bin" | ||
- name: Build pedal STM image | ||
run: $RUN "cd /tmp/openpilot/panda/board/pedal && make obj/comma.bin" | ||
- name: Build pedal STM bootstub image | ||
run: $RUN "cd /tmp/openpilot/panda/board/pedal && make obj/bootstub.bin" | ||
|
||
build_esp: | ||
name: build esp | ||
runs-on: ubuntu-16.04 | ||
timeout-minutes: 40 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build docker image | ||
run: | | ||
docker pull docker.io/commaai/panda_esp:latest || true | ||
docker build --cache-from docker.io/commaai/panda_esp:latest -t panda_esp -f tests/build/Dockerfile.panda_esp . | ||
- name: Build ESP image | ||
run: docker run --rm panda_esp /bin/sh -c "cd /panda/boardesp && make user1.bin" | ||
- name: Push image | ||
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/panda' | ||
run: | | ||
docker login -u wmelching -p ${{ secrets.DOCKERHUB_TOKEN }} | ||
docker tag panda_esp docker.io/commaai/panda_esp:latest | ||
docker push docker.io/commaai/panda_esp:latest | ||
safety: | ||
name: safety | ||
runs-on: ubuntu-16.04 | ||
timeout-minutes: 10 | ||
needs: docker_build | ||
steps: | ||
- uses: actions/download-artifact@v1 | ||
with: | ||
name: panda.tar.gz | ||
- name: Load image | ||
run: $LOAD | ||
- name: Run safety tests | ||
run: $RUN "cd /tmp/openpilot/panda/tests/safety && ./test.sh" | ||
|
||
safety_replay: | ||
name: safety replay | ||
runs-on: ubuntu-16.04 | ||
timeout-minutes: 10 | ||
needs: docker_build | ||
steps: | ||
- uses: actions/download-artifact@v1 | ||
with: | ||
name: panda.tar.gz | ||
- name: Load image | ||
run: $LOAD | ||
- name: Run safety replay | ||
run: $RUN "cd /tmp/openpilot/panda/tests/safety_replay && ./test_safety_replay.py" | ||
|
||
misra: | ||
name: misra c2012 | ||
runs-on: ubuntu-16.04 | ||
timeout-minutes: 10 | ||
needs: docker_build | ||
steps: | ||
- uses: actions/download-artifact@v1 | ||
with: | ||
name: panda.tar.gz | ||
- name: Load image | ||
run: $LOAD | ||
- name: Run Misra C 2012 analysis | ||
run: $PERSIST "cd /tmp/openpilot/panda/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.txt | ||
path: /tmp/misra/cppcheck_output.txt | ||
- uses: actions/upload-artifact@v2 | ||
if: always() | ||
with: | ||
name: misra.txt | ||
path: /tmp/misra/misra_output.txt | ||
|
||
python_linter: | ||
name: python linter | ||
runs-on: ubuntu-16.04 | ||
timeout-minutes: 10 | ||
needs: docker_build | ||
steps: | ||
- uses: actions/download-artifact@v1 | ||
with: | ||
name: panda.tar.gz | ||
- name: Load image | ||
run: $LOAD | ||
- name: Run linters | ||
run: | | ||
$RUN "cd /tmp/openpilot/panda/tests/linter_python/ && ./flake8_panda.sh" | ||
$RUN "cd /tmp/openpilot/panda/tests/linter_python/ && ./pylint_panda.sh" |
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,68 @@ | ||
FROM ubuntu:16.04 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
autoconf \ | ||
automake \ | ||
bzip2 \ | ||
capnproto \ | ||
clang \ | ||
curl \ | ||
g++ \ | ||
gcc-arm-none-eabi libnewlib-arm-none-eabi \ | ||
git \ | ||
libarchive-dev \ | ||
libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libavresample-dev libavfilter-dev \ | ||
libbz2-dev \ | ||
libcapnp-dev \ | ||
libcurl4-openssl-dev \ | ||
libffi-dev \ | ||
libtool \ | ||
libssl-dev \ | ||
libusb-1.0-0 \ | ||
libzmq3-dev \ | ||
locales \ | ||
make \ | ||
ncurses-dev \ | ||
pkg-config \ | ||
python \ | ||
python-dev \ | ||
python-pip \ | ||
unzip \ | ||
wget \ | ||
zlib1g-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
|
||
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash | ||
|
||
ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}" | ||
RUN pyenv install 3.7.3 && pyenv global 3.7.3 | ||
RUN pyenv rehash | ||
|
||
RUN pip install --no-cache-dir --upgrade pip==18.0 | ||
|
||
COPY requirements.txt /tmp/ | ||
RUN pip install --no-cache-dir -r /tmp/requirements.txt | ||
|
||
ENV PYTHONPATH /tmp/openpilot:$PYTHONPATH | ||
|
||
WORKDIR /tmp | ||
RUN git clone https://github.com/commaai/openpilot.git || true && \ | ||
cd /tmp/openpilot && \ | ||
git pull && git checkout 44560b5bb74e451767725144c3fa5f1564481a20 && \ | ||
git submodule update --init cereal opendbc && \ | ||
rm -rf $(ls --hide="common" --hide="selfdrive" --hide="cereal" --hide="opendbc" --hide="tools" --hide="SConstruct") | ||
|
||
RUN cd /tmp/openpilot && \ | ||
pip install --no-cache-dir -r opendbc/requirements.txt && \ | ||
pip install --no-cache-dir -r tools/requirements.txt | ||
|
||
WORKDIR /tmp/openpilot | ||
RUN scons -c && scons -j$(nproc) opendbc/ cereal/ | ||
|
||
COPY . /tmp/openpilot/panda |
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
Oops, something went wrong.