-
Notifications
You must be signed in to change notification settings - Fork 25
50 lines (46 loc) · 1.51 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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-24.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-24.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-24.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"