Skip to content

Commit c082b5c

Browse files
authored
Merge pull request #390 from openworm/test_all
Improve Docker testing setup
2 parents 7ed78fb + 8cebeac commit c082b5c

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Docker Image Build and Run
22

33
on:
4+
schedule:
5+
- cron: "1 1 29 */1 *" # Run once a month to test...
46
push:
57
branches: [ master, dev*, experimental, test* ]
68
pull_request:
@@ -20,14 +22,20 @@ jobs:
2022
chmod a+w output/
2123
ls -alth
2224
./build.sh
25+
2326
- name: Info on Docker images
2427
run: |
2528
docker -v
2629
docker images
2730
31+
- name: Run all sibernetic tests
32+
run: |
33+
./run-tests.sh
34+
2835
- name: Run the Docker image with the default falling cube demo from sibernetic
2936
run: |
3037
#### sudo apt-get update && sudo apt-get install -y x11-xserver-utils # for xhost
38+
./stop.sh
3139
./run.sh -d 20 -c demo1
3240
3341
- name: Run the Docker image with a worm simulation - no c302

run-tests.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
set -ex
3+
4+
OW_OUT_DIR=/home/ow/shared
5+
HOST_OUT_DIR=$PWD
6+
7+
version=$(<VERSION) # Read version of Dockerfile from file VERSION
8+
9+
docker run -d \
10+
--name openworm_$version \
11+
--device=/dev/dri:/dev/dri \
12+
-e DISPLAY=$DISPLAY \
13+
-e OW_OUT_DIR=$OW_OUT_DIR \
14+
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
15+
--privileged \
16+
-v $HOST_OUT_DIR:$OW_OUT_DIR:rw \
17+
openworm/openworm:$version \
18+
bash -c "cd /home/ow/sibernetic && time ./test.sh"
19+
20+
echo "Set running running Docker container with Sibernetic in detached mode. Attaching to logs now..."
21+
22+
docker logs -f openworm_$version
23+
24+
echo "Finished running the Docker container"

0 commit comments

Comments
 (0)