This package provides a python script periodically for periodically checking a github repo and running tests for PullRequests using industrial_ci.
To avoid running arbitrary PRs on the machine only PullRequests containing the string "- [ ] Perform hardware tests" and with commits from allowed users are checked. The start and finish of the test are reported with a comment on the issue.
In order to run the script you need:
industrial_ci
installed locally and sourced (see instructions here)
For example the tests running on https://github.com/PilzDE/psen_scan_v2 use:
rosrun pilz_github_ci_runner test_repository.py "PilzDE/psen_scan_v2" \
"rfeistenauer agutenkunst" \
--setup-cmd="usbrelay 1_1=0; sleep 2; usbrelay 1_1=1" --cleanup-cmd="usbrelay 1_1=0" \
CMAKE_ARGS="-DENABLE_HARDWARE_TESTING=ON"
APT_PROXY=http://172.20.20.104:3142 \
DOCKER_RUN_OPTS="-v /usr/local/share/ca-certificates:/usr/local/share/ca-certificates:ro -p 55000-55020:55000-55020/udp -p 55116:55116/udp --env HOST_IP=192.168.0.122 --env SENSOR_IP=192.168.0.100" \
For continuous running add a --loop_time=<seconds_for_refresh>
The tests are only run if the pull request
or
Note:
This package originates from the desire the to have test running with actual hardware that are triggered by Github PullRequests. While Github offers so called "Self-hosted runners" these are critical when working with public repos (see here, here and here). Until a better solution is available we stick with this approach ensuring some security by allowing only code from or approved by dedicated users to be run the local machine in order to mitigate some of the security concerns.