Build openpilot with webcam support in CI (#2070)

old-commit-hash: f4e18e0b74
This commit is contained in:
Adeeb Shihadeh
2020-10-16 15:16:17 -07:00
committed by GitHub
parent f63c297ba8
commit fb935fa5f7
7 changed files with 82 additions and 12 deletions

View File

@@ -10,16 +10,13 @@ env:
CI_RUN: docker run -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID --rm tmppilotci /bin/bash -c
UNIT_TEST: coverage run --append -m unittest discover
BUILD: |
# build the openpilot docker base image
docker pull $(grep -ioP '(?<=^from)\s+\S+' Dockerfile.openpilot_base) || true
docker pull docker.io/commaai/openpilot-base:latest || true
docker build --cache-from docker.io/commaai/openpilot-base:latest -t commaai/openpilot-base:latest -f Dockerfile.openpilot_base .
# build the final CI image
docker pull docker.io/commaai/openpilotci:latest || true
docker build --cache-from docker.io/commaai/openpilotci:latest -t tmppilot -f Dockerfile.openpilotci .
jobs:
build_release:
name: build release
@@ -78,6 +75,27 @@ jobs:
- name: Brew cleanup
run: brew cleanup || true # keeps our cache small
build_webcam:
name: build webcam
runs-on: ubuntu-16.04
timeout-minutes: 90
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build Docker image
run: |
docker pull docker.io/commaai/openpilotwebcamci:latest
docker build --cache-from docker.io/commaai/openpilotwebcamci:latest -t tmppilotwebcam -f tools/webcam/Dockerfile .
- name: Build openpilot
run: docker run --shm-size 1G --rm tmppilotwebcam /bin/sh -c "cd /tmp/openpilot && USE_WEBCAM=1 scons -j$(nproc)"
- name: Push to dockerhub
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/openpilot'
run: |
docker login -u wmelching -p ${{ secrets.COMMA_DOCKERHUB_TOKEN}}
docker tag tmppilotwebcam docker.io/commaai/openpilotwebcamci:latest
docker push docker.io/commaai/openpilotwebcamci:latest
docker_push:
name: docker push
runs-on: ubuntu-16.04