-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add basic CI * trim this down * add back ssl * add that back * fix
- Loading branch information
1 parent
74ef5a4
commit e599b6d
Showing
6 changed files
with
151 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: tests | ||
on: [push, pull_request] | ||
|
||
env: | ||
RUN: docker run --rm body /bin/bash -c | ||
PERSIST: docker run --name body body /bin/sh -c | ||
BUILD: | | ||
docker pull $(grep -ioP '(?<=^from)\s+\S+' Dockerfile) || true | ||
docker pull ghcr.io/commaai/body:latest || true | ||
docker build --cache-from ghcr.io/commaai/body:latest -t body -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/body' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build Docker image | ||
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 body ghcr.io/commaai/body:latest | ||
- name: Push image | ||
run: docker push ghcr.io/commaai/body:latest | ||
|
||
build: | ||
name: build | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 45 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build Docker image | ||
run: eval "$BUILD" | ||
- name: Build firmware | ||
run: $RUN "cd /tmp/openpilot/body && scons" | ||
|
||
python_linter: | ||
name: python linter | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 45 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build Docker image | ||
run: eval "$BUILD" | ||
- name: Run static analysis | ||
run: | | ||
$RUN "cd /tmp/openpilot/body && git init && git add -A && pre-commit run --all" |
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,31 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
hooks: | ||
- id: check-ast | ||
- id: check-yaml | ||
- id: check-merge-conflict | ||
- id: check-symlinks | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.971 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: ['git+https://github.com/numpy/numpy-stubs', 'types-requests', 'types-atomicwrites', | ||
'types-pycurl'] | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 5.0.4 | ||
hooks: | ||
- id: flake8 | ||
args: | ||
- --select=F,E112,E113,E304,E501,E502,E701,E702,E703,E71,E72,E731,W191,W6 | ||
- --max-line-length=160 | ||
- --statistics | ||
- repo: local | ||
hooks: | ||
- id: pylint | ||
name: pylint | ||
entry: pylint | ||
language: system | ||
types: [python] | ||
args: | ||
- --disable=C,R,W0613,W0511,W0212,W0201,W0311,W0106,W0603,W0621,W0703,E1136 |
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,40 @@ | ||
FROM ubuntu:20.04 | ||
ENV PYTHONUNBUFFERED 1 | ||
ENV PYTHONPATH /tmp/openpilot:$PYTHONPATH | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
autoconf \ | ||
automake \ | ||
ca-certificates \ | ||
clang \ | ||
curl \ | ||
g++ \ | ||
gcc-arm-none-eabi libnewlib-arm-none-eabi \ | ||
git \ | ||
libtool \ | ||
libssl-dev \ | ||
libsqlite3-dev \ | ||
locales \ | ||
make \ | ||
patch \ | ||
pkg-config \ | ||
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}" | ||
|
||
COPY requirements.txt /tmp/ | ||
RUN pyenv install 3.8.10 && \ | ||
pyenv global 3.8.10 && \ | ||
pyenv rehash && \ | ||
pip install --no-cache-dir -r /tmp/requirements.txt | ||
|
||
COPY . /tmp/openpilot/body | ||
RUN rm -rf /tmp/openpilot/body/.git |
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,5 @@ | ||
cffi | ||
scons | ||
pylint | ||
pre-commit | ||
pycryptodome==3.9.8 |