@@ -42,6 +42,7 @@ def phone_steps(String device_type, steps) {
4242pipeline {
4343 agent none
4444 environment {
45+ CI = " 1"
4546 TEST_DIR = " /data/openpilot"
4647 SOURCE_DIR = " /data/openpilot_source/"
4748 }
@@ -74,71 +75,89 @@ pipeline {
7475 }
7576 }
7677
77- stages {
78- stage(' On-device Tests' ) {
79- agent { docker { image ' ghcr.io/commaai/alpine-ssh' ; args ' --user=root' } }
80- stages {
81- stage(' parallel tests' ) {
82- parallel {
83- stage(' build' ) {
84- environment {
85- R3_PUSH = " ${ env.BRANCH_NAME == 'master' ? '1' : ' '} "
86- }
87- steps {
88- phone_steps(" tici" , [
89- [" build master-ci" , " cd $SOURCE_DIR /release && TARGET_DIR=$TEST_DIR EXTRA_FILES='tools/' ./build_devel.sh" ],
90- [" build openpilot" , " cd selfdrive/manager && ./build.py" ],
91- [" test manager" , " python selfdrive/manager/test/test_manager.py" ],
92- [" onroad tests" , " cd selfdrive/test/ && ./test_onroad.py" ],
93- [" test car interfaces" , " cd selfdrive/car/tests/ && ./test_car_interfaces.py" ],
94- ])
95- }
96- }
97-
98- stage(' HW + Unit Tests' ) {
99- steps {
100- phone_steps(" tici2" , [
101- [" build" , " cd selfdrive/manager && ./build.py" ],
102- [" test power draw" , " python selfdrive/hardware/tici/test_power_draw.py" ],
103- [" test boardd loopback" , " python selfdrive/boardd/tests/test_boardd_loopback.py" ],
104- [" test loggerd" , " python selfdrive/loggerd/tests/test_loggerd.py" ],
105- [" test encoder" , " LD_LIBRARY_PATH=/usr/local/lib python selfdrive/loggerd/tests/test_encoder.py" ],
106- [" test sensord" , " python selfdrive/sensord/test/test_sensord.py" ],
107- ])
108- }
109- }
110-
111- stage(' camerad' ) {
112- steps {
113- phone_steps(" tici-party" , [
114- [" build" , " cd selfdrive/manager && ./build.py" ],
115- [" test camerad" , " python selfdrive/camerad/test/test_camerad.py" ],
116- [" test exposure" , " python selfdrive/camerad/test/test_exposure.py" ],
117- ])
118- }
119- }
120-
121- stage(' replay' ) {
122- steps {
123- phone_steps(" tici3" , [
124- [" build" , " cd selfdrive/manager && ./build.py" ],
125- [" model replay" , " cd selfdrive/test/process_replay && ./model_replay.py" ],
126- ])
127- }
128- }
129-
130- }
78+ parallel {
79+
80+ stage(' simulator' ) {
81+ agent {
82+ dockerfile {
83+ filename ' Dockerfile.sim_nvidia'
84+ dir ' tools/sim'
85+ args ' --user=root'
13186 }
13287 }
88+ steps {
89+ sh " git config --global --add safe.directory ${ WORKSPACE} "
90+ sh " git lfs pull"
91+ sh " ${ WORKSPACE} /tools/sim/build_container.sh"
92+ sh " DETACH=1 ${ WORKSPACE} /tools/sim/start_carla.sh"
93+ sh " ${ WORKSPACE} /tools/sim/start_openpilot_docker.sh"
94+ }
13395
13496 post {
13597 always {
136- cleanWs()
98+ sh " docker kill carla_sim || true"
99+ sh " rm -rf ${ WORKSPACE} /* || true"
100+ sh " rm -rf .* || true"
137101 }
138102 }
103+ }
139104
105+ stage(' build' ) {
106+ agent { docker { image ' ghcr.io/commaai/alpine-ssh' ; args ' --user=root' } }
107+ environment {
108+ R3_PUSH = " ${ env.BRANCH_NAME == 'master' ? '1' : ' '} "
109+ }
110+ steps {
111+ phone_steps(" tici" , [
112+ [" build master-ci" , " cd $SOURCE_DIR /release && TARGET_DIR=$TEST_DIR EXTRA_FILES='tools/' ./build_devel.sh" ],
113+ [" build openpilot" , " cd selfdrive/manager && ./build.py" ],
114+ [" test manager" , " python selfdrive/manager/test/test_manager.py" ],
115+ [" onroad tests" , " cd selfdrive/test/ && ./test_onroad.py" ],
116+ [" test car interfaces" , " cd selfdrive/car/tests/ && ./test_car_interfaces.py" ],
117+ ])
118+ }
119+ }
120+
121+ stage(' HW + Unit Tests' ) {
122+ agent { docker { image ' ghcr.io/commaai/alpine-ssh' ; args ' --user=root' } }
123+ steps {
124+ phone_steps(" tici2" , [
125+ [" build" , " cd selfdrive/manager && ./build.py" ],
126+ [" test power draw" , " python selfdrive/hardware/tici/test_power_draw.py" ],
127+ [" test boardd loopback" , " python selfdrive/boardd/tests/test_boardd_loopback.py" ],
128+ [" test loggerd" , " python selfdrive/loggerd/tests/test_loggerd.py" ],
129+ [" test encoder" , " LD_LIBRARY_PATH=/usr/local/lib python selfdrive/loggerd/tests/test_encoder.py" ],
130+ [" test sensord" , " python selfdrive/sensord/test/test_sensord.py" ],
131+ ])
132+ }
140133 }
141134
135+ stage(' camerad' ) {
136+ agent { docker { image ' ghcr.io/commaai/alpine-ssh' ; args ' --user=root' } }
137+ steps {
138+ phone_steps(" tici-party" , [
139+ [" build" , " cd selfdrive/manager && ./build.py" ],
140+ [" test camerad" , " python selfdrive/camerad/test/test_camerad.py" ],
141+ [" test exposure" , " python selfdrive/camerad/test/test_exposure.py" ],
142+ ])
143+ }
144+ }
145+
146+ stage(' replay' ) {
147+ agent { docker { image ' ghcr.io/commaai/alpine-ssh' ; args ' --user=root' } }
148+ steps {
149+ phone_steps(" tici3" , [
150+ [" build" , " cd selfdrive/manager && ./build.py" ],
151+ [" model replay" , " cd selfdrive/test/process_replay && ./model_replay.py" ],
152+ ])
153+ }
154+ }
155+ }
156+
157+ post {
158+ always {
159+ cleanWs()
160+ }
142161 }
143162 }
144163 }
0 commit comments