forked from commaai/panda
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (97 loc) · 3.18 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: tests
on: [push, pull_request]
env:
RUN: docker run --rm panda /bin/bash -c
PERSIST: docker run --name panda panda /bin/sh -c
BUILD: |
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 .
jobs:
docker_push:
name: docker push
runs-on: ubuntu-20.04
timeout-minutes: 45
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/panda'
steps:
- uses: actions/checkout@v2
- name: Build Docker image
run: eval "$BUILD"
- name: Login to dockerhub
run: docker login -u wmelching -p ${{ secrets.COMMA_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-20.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v2
- name: Build Docker image
run: eval "$BUILD"
- name: Test python package installer
run: $RUN "cd /tmp/openpilot/panda && python setup.py install"
- name: Build panda STM image and bootstub
run: $RUN "cd /tmp/openpilot/panda && scons"
- name: Build pedal STM image and bootstub
run: $RUN "cd /tmp/openpilot/panda && PEDAL=1 scons"
safety:
name: safety
runs-on: ubuntu-20.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v2
- name: Build Docker image
run: eval "$BUILD"
- name: Run safety tests
run: |
$RUN "cd /tmp/openpilot && \
scons -c && \
scons -j$(nproc) -i opendbc/ cereal/ && \
cd panda/tests/safety && \
./test.sh"
safety_replay:
name: safety replay
runs-on: ubuntu-20.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v2
- name: Build Docker image
run: eval "$BUILD"
- name: Run safety replay
run: $RUN "cd /tmp/openpilot/panda/tests/safety_replay && ./test_safety_replay.py"
misra:
name: misra c2012
runs-on: ubuntu-20.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v2
- name: Build Docker image
run: eval "$BUILD"
- 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_output
path: /tmp/misra/cppcheck_*_output.txt
- uses: actions/upload-artifact@v2
if: always()
with:
name: misra_output
path: /tmp/misra/misra_*_output.txt
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/panda && git init && git add -A && pre-commit run --all"