Browse Source

Remove support for Travis CI

tempestpy_adaptions
Matthias Volk 4 years ago
committed by Matthias Volk
parent
commit
996da02efd
  1. 2
      .gitignore
  2. 591
      .travis.yml
  3. 2
      doc/checklist_new_release.md
  4. 87
      travis/build.sh
  5. 41
      travis/build_carl.sh
  6. 89
      travis/build_carl_helper.sh
  7. 174
      travis/build_helper.sh
  8. 48
      travis/deploy_docker.sh
  9. 155
      travis/generate_travis.py
  10. 66
      travis/install_osx.sh
  11. 8
      travis/mtime_cache/globs.txt
  12. 178
      travis/mtime_cache/mtime_cache.rb
  13. 6
      travis/skip_test.sh

2
.gitignore

@ -50,5 +50,3 @@ nbproject/
*.out *.out
resources/3rdparty/cudd-3.0.0/Makefile.in resources/3rdparty/cudd-3.0.0/Makefile.in
resources/3rdparty/cudd-3.0.0/aclocal.m4 resources/3rdparty/cudd-3.0.0/aclocal.m4
# Travis helpers
travis/mtime_cache/cache.json

591
.travis.yml

@ -1,591 +0,0 @@
#
# General config
#
branches:
only:
- master
- stable
sudo: required
language: cpp
git:
depth: false
# Enable caching
cache:
timeout: 1000
directories:
- build
- travis/mtime_cache
# Enable docker support
services:
- docker
notifications:
email:
on_failure: always
on_success: change
recipients:
- secure: "VWnsiQkt1xjgRo1hfNiNQqvLSr0fshFmLV7jJlUixhCr094mgD0U2bNKdUfebm28Byg9UyDYPbOFDC0sx7KydKiL1q7FKKXkyZH0k04wUu8XiNw+fYkDpmPnQs7G2n8oJ/GFJnr1Wp/1KI3qX5LX3xot4cJfx1I5iFC2O+p+ng6v/oSX+pewlMv4i7KL16ftHHHMo80N694v3g4B2NByn4GU2/bjVQcqlBp/TiVaUa5Nqu9DxZi/n9CJqGEaRHOblWyMO3EyTZsn45BNSWeQ3DtnMwZ73rlIr9CaEgCeuArc6RGghUAVqRI5ao+N5apekIaILwTgL6AJn+Lw/+NRPa8xclgd0rKqUQJMJCDZKjKz2lmIs3bxfELOizxJ3FJQ5R95FAxeAZ6rb/j40YqVVTw2IMBDnEE0J5ZmpUYNUtPti/Adf6GD9Fb2y8sLo0XDJzkI8OxYhfgjSy5KYmRj8O5MXcP2MAE8LQauNO3MaFnL9VMVOTZePJrPozQUgM021uyahf960+QNI06Uqlmg+PwWkSdllQlxHHplOgW7zClFhtSUpnJxcsUBzgg4kVg80gXUwAQkaDi7A9Wh2bs+TvMlmHzBwg+2SaAfWDgjeJIeOaipDkF1uSGzC+EHAiiKYMLd4Aahoi8SuelJUucoyJyLAq00WdUFQIh/izVhM4Y="
#
# Configurations
#
jobs:
include:
###
# Stage: Build Carl
###
# ubuntu-20.04 - DefaultDebugTravis
- stage: Build Carl
os: linux
compiler: gcc
env: CONFIG=DefaultDebugTravis TASK=TestDocker LINUX=ubuntu-20.04 COMPILER=gcc
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build_carl.sh
before_cache:
- docker cp carl:/opt/carl/. .
deploy:
- provider: script
skip_cleanup: true
script: bash travis/deploy_docker.sh carl
# ubuntu-20.04 - DefaultReleaseTravis
- stage: Build Carl
os: linux
compiler: gcc
env: CONFIG=DefaultReleaseTravis TASK=TestDockerDoxygen LINUX=ubuntu-20.04 COMPILER=gcc
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build_carl.sh
before_cache:
- docker cp carl:/opt/carl/. .
deploy:
- provider: script
skip_cleanup: true
script: bash travis/deploy_docker.sh carl
###
# Stage: Build (1st run)
###
# ubuntu-18.04 - DefaultDebug
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug TASK=Test LINUX=ubuntu-18.04 COMPILER=gcc
install:
- rm -rf build
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build1
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultRelease
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease TASK=Test LINUX=ubuntu-18.04 COMPILER=gcc
install:
- rm -rf build
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build1
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9 - DefaultDebug
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug TASK=Test LINUX=debian-9 COMPILER=gcc
install:
- rm -rf build
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build1
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9 - DefaultRelease
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease TASK=Test LINUX=debian-9 COMPILER=gcc
install:
- rm -rf build
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build1
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-10 - DefaultDebug
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug TASK=Test LINUX=debian-10 COMPILER=gcc
install:
- rm -rf build
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build1
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-10 - DefaultRelease
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease TASK=Test LINUX=debian-10 COMPILER=gcc
install:
- rm -rf build
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build1
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-20.04 - DefaultDebugTravis
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebugTravis TASK=TestDocker LINUX=ubuntu-20.04 COMPILER=gcc
install:
- rm -rf build
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build1
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-20.04 - DefaultReleaseTravis
- stage: Build (1st run)
os: linux
compiler: gcc
env: CONFIG=DefaultReleaseTravis TASK=TestDockerDoxygen LINUX=ubuntu-20.04 COMPILER=gcc
install:
- rm -rf build
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build1
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
###
# Stage: Build (2nd run)
###
# ubuntu-18.04 - DefaultDebug
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug TASK=Test LINUX=ubuntu-18.04 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build2
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultRelease
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease TASK=Test LINUX=ubuntu-18.04 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build2
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9 - DefaultDebug
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug TASK=Test LINUX=debian-9 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build2
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9 - DefaultRelease
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease TASK=Test LINUX=debian-9 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build2
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-10 - DefaultDebug
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug TASK=Test LINUX=debian-10 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build2
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-10 - DefaultRelease
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease TASK=Test LINUX=debian-10 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build2
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-20.04 - DefaultDebugTravis
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebugTravis TASK=TestDocker LINUX=ubuntu-20.04 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build2
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-20.04 - DefaultReleaseTravis
- stage: Build (2nd run)
os: linux
compiler: gcc
env: CONFIG=DefaultReleaseTravis TASK=TestDockerDoxygen LINUX=ubuntu-20.04 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Build2
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
###
# Stage: Build (3rd run)
###
# ubuntu-18.04 - DefaultDebug
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug TASK=Test LINUX=ubuntu-18.04 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh BuildLast
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultRelease
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease TASK=Test LINUX=ubuntu-18.04 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh BuildLast
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9 - DefaultDebug
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug TASK=Test LINUX=debian-9 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh BuildLast
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9 - DefaultRelease
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease TASK=Test LINUX=debian-9 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh BuildLast
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-10 - DefaultDebug
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebug TASK=Test LINUX=debian-10 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh BuildLast
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-10 - DefaultRelease
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultRelease TASK=Test LINUX=debian-10 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh BuildLast
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-20.04 - DefaultDebugTravis
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultDebugTravis TASK=TestDocker LINUX=ubuntu-20.04 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh BuildLast
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-20.04 - DefaultReleaseTravis
- stage: Build (3rd run)
os: linux
compiler: gcc
env: CONFIG=DefaultReleaseTravis TASK=TestDockerDoxygen LINUX=ubuntu-20.04 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh BuildLast
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
###
# Stage: Tasks
###
# ubuntu-18.04 - DefaultDebug
- stage: Tasks
os: linux
compiler: gcc
env: CONFIG=DefaultDebug TASK=Test LINUX=ubuntu-18.04 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Tasks
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-18.04 - DefaultRelease
- stage: Tasks
os: linux
compiler: gcc
env: CONFIG=DefaultRelease TASK=Test LINUX=ubuntu-18.04 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Tasks
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9 - DefaultDebug
- stage: Tasks
os: linux
compiler: gcc
env: CONFIG=DefaultDebug TASK=Test LINUX=debian-9 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Tasks
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-9 - DefaultRelease
- stage: Tasks
os: linux
compiler: gcc
env: CONFIG=DefaultRelease TASK=Test LINUX=debian-9 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Tasks
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-10 - DefaultDebug
- stage: Tasks
os: linux
compiler: gcc
env: CONFIG=DefaultDebug TASK=Test LINUX=debian-10 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Tasks
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# debian-10 - DefaultRelease
- stage: Tasks
os: linux
compiler: gcc
env: CONFIG=DefaultRelease TASK=Test LINUX=debian-10 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Tasks
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
# ubuntu-20.04 - DefaultDebugTravis
- stage: Tasks
os: linux
compiler: gcc
env: CONFIG=DefaultDebugTravis TASK=TestDocker LINUX=ubuntu-20.04 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Tasks
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
deploy:
- provider: script
skip_cleanup: true
script: bash travis/deploy_docker.sh storm
# ubuntu-20.04 - DefaultReleaseTravis
- stage: Tasks
os: linux
compiler: gcc
env: CONFIG=DefaultReleaseTravis TASK=TestDockerDoxygen LINUX=ubuntu-20.04 COMPILER=gcc
install:
- travis/skip_test.sh
before_script:
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode
script:
- travis/build.sh Tasks
before_cache:
- docker cp storm:/opt/storm/. .
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
deploy:
- provider: script
skip_cleanup: true
script: bash travis/deploy_docker.sh storm
- provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
local_dir: build/doc/html/
repo: moves-rwth/storm-doc
target_branch: master
on:
branch: master

2
doc/checklist_new_release.md

@ -13,7 +13,7 @@ Note that in most cases a simultaneous release of [carl](https://github.com/smtr
* Maybe update `CARL_MINVERSION` in `resources/3rdparty/CMakeLists.txt` * Maybe update `CARL_MINVERSION` in `resources/3rdparty/CMakeLists.txt`
3. Check that storm builds without errors and all tests are successful: 3. Check that storm builds without errors and all tests are successful:
* [Travis](https://travis-ci.org/moves-rwth/storm) should run successfully.
* [Github Actions](https://github.com/moves-rwth/storm/actions/) should run successfully.
* Invoke the script `doc/scripts/test_build_configurations.py` to build and check different CMake configurations. * Invoke the script `doc/scripts/test_build_configurations.py` to build and check different CMake configurations.
4. Set new storm version: 4. Set new storm version:

87
travis/build.sh

@ -1,87 +0,0 @@
#!/bin/bash -x
N_JOBS=2
TIMEOUT_MAC=1600
TIMEOUT_LINUX=2300
OS=$TRAVIS_OS_NAME
EXITCODE=42
# Skip this run?
if [ -f build/skip.txt ]
then
# Remove flag s.t. tests will be executed
if [[ "$1" == "BuildLast" ]]
then
rm build/skip.txt
fi
exit 0
fi
case $OS in
linux)
# Execute docker image on Linux
# Stop previous session
docker rm -f storm &>/dev/null
# Run container
set -e
case "$CONFIG" in
*DebugTravis)
docker run -d -it --name storm --privileged movesrwth/carl:travis-debug
;;
*ReleaseTravis)
docker run -d -it --name storm --privileged movesrwth/carl:travis
;;
*)
docker run -d -it --name storm --privileged movesrwth/storm-basesystem:$LINUX
;;
esac
# Install doxygen if necessary
if [[ "$TASK" == *Doxygen* ]]
then
docker exec storm apt-get install -qq -y doxygen graphviz
fi
# Copy local content into container
docker exec storm mkdir /opt/storm
docker cp . storm:/opt/storm
set +e
# Execute main process
docker exec storm bash -c "
export CONFIG=$CONFIG;
export TASK=$TASK;
export COMPILER=$COMPILER;
export N_JOBS=$N_JOBS;
export STLARG=;
export OS=$OS;
cd /opt/storm;
timeout $TIMEOUT_LINUX ./travis/build_helper.sh $1"
EXITCODE=$?
;;
osx)
# Mac OSX
STLARG="-stdlib=libc++"
export CONFIG
export TASK
export COMPILER
export N_JOBS
export STLARG
export OS
gtimeout $TIMEOUT_MAC travis/build_helper.sh "$1"
EXITCODE=$?
;;
*)
# Unknown OS
echo "Unsupported OS: $OS"
exit 1
esac
if [[ $EXITCODE == 124 ]] && [[ "$1" == Build* ]] && [[ "$1" != "BuildLast" ]]
then
exit 0
else
exit $EXITCODE
fi

41
travis/build_carl.sh

@ -1,41 +0,0 @@
#!/bin/bash -x
N_JOBS=2
TIMEOUT_LINUX=2300
OS=$TRAVIS_OS_NAME
case $OS in
linux)
# Execute docker image on Linux
# Stop previous session
docker rm -f carl &>/dev/null
# Run container
set -e
docker run -d -it --name carl --privileged movesrwth/storm-basesystem:$LINUX
# Copy local content into container
docker cp travis/build_carl_helper.sh carl:/opt/
set +e
# Execute main process
docker exec carl bash -c "
export CONFIG=$CONFIG;
export COMPILER=$COMPILER;
export N_JOBS=$N_JOBS;
export STLARG=;
export OS=$OS;
cd /opt/;
timeout $TIMEOUT_LINUX ./build_carl_helper.sh"
;;
osx)
echo "Building carl on Mac OSX not used."
exit 1
;;
*)
# Unknown OS
echo "Unsupported OS: $OS"
exit 1
esac

89
travis/build_carl_helper.sh

@ -1,89 +0,0 @@
#!/bin/bash
set -e
# Helper for travis folding
travis_fold() {
local action=$1
local name=$2
echo -en "travis_fold:${action}:${name}\r"
}
# Helper for building and testing
run() {
travis_fold start install_dependencies
apt-get update
#apt-get install -qq -y openjdk-8-jdk maven uuid-dev pkg-config
apt-get install -qq -y uuid-dev pkg-config
travis_fold end install_dependencies
travis_fold start install_carl
git clone https://github.com/smtrat/carl.git
cd carl
git checkout master14
mkdir build
cd build
cmake .. "${CMAKE_ARGS[@]}"
#make lib_carl addons -j$N_JOBS
make lib_carl -j$N_JOBS
travis_fold end install_carl
}
# This only exists in OS X, but it doesn't cause issues in Linux (the dir doesn't exist, so it's
# ignored).
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
case $COMPILER in
gcc-6)
export CC=gcc-6
export CXX=g++-6
;;
gcc)
export CC=gcc
export CXX=g++
;;
clang-4)
case "$OS" in
linux)
export CC=clang-4.0
export CXX=clang++-4.0
;;
osx)
export CC=/usr/local/opt/llvm/bin/clang-4.0
export CXX=/usr/local/opt/llvm/bin/clang++
;;
*) echo "Error: unexpected OS: $OS"; exit 1 ;;
esac
;;
clang)
export CC=clang
export CXX=clang++
;;
*)
echo "Unrecognized value of COMPILER: $COMPILER"
exit 1
esac
# Build
echo CXX version: $($CXX --version)
echo C++ Standard library location: $(echo '#include <vector>' | $CXX -x c++ -E - | grep 'vector\"' | awk '{print $3}' | sed 's@/vector@@;s@\"@@g' | head -n 1)
echo Normalized C++ Standard library location: $(readlink -f $(echo '#include <vector>' | $CXX -x c++ -E - | grep 'vector\"' | awk '{print $3}' | sed 's@/vector@@;s@\"@@g' | head -n 1))
case "$CONFIG" in
DefaultDebug*)
CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG" -DUSE_CLN_NUMBERS=ON -DUSE_GINAC=ON -DTHREAD_SAFE=ON -DBUILD_ADDONS=ON -DBUILD_ADDON_PARSER=ON)
;;
DefaultRelease*)
CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$STLARG" -DUSE_CLN_NUMBERS=ON -DUSE_GINAC=ON -DTHREAD_SAFE=ON -DBUILD_ADDONS=ON -DBUILD_ADDON_PARSER=ON)
;;
*)
echo "Unrecognized value of CONFIG: $CONFIG"; exit 1
;;
esac
run

174
travis/build_helper.sh

@ -1,174 +0,0 @@
#!/bin/bash
set -e
# Helper for travis folding
travis_fold() {
local action=$1
local name=$2
echo -en "travis_fold:${action}:${name}\r"
}
# Helper to write output every minute
function bell() {
while true; do
echo "travis_wait for it..."
sleep 60
done
}
# Helper for distinguishing between different runs
run() {
case "$1" in
Build*)
if [[ "$1" == "Build1" ]]
then
# CMake
travis_fold start cmake
mkdir build
cd build
cmake .. "${CMAKE_ARGS[@]}"
echo
if [ -f "CMakeFiles/CMakeError.log" ]
then
echo "Content of CMakeFiles/CMakeError.log:"
cat CMakeFiles/CMakeError.log
fi
echo
cd ..
travis_fold end cmake
fi
# Make
travis_fold start make
cd build
make -j$N_JOBS
travis_fold end make
# Set skip-file
if [[ "$1" != "BuildLast" ]]
then
touch skip.txt
else
rm -rf skip.txt
fi
;;
Tasks)
# Perform tasks
if [[ "$TASK" == *Test* ]]
then
# Test all
travis_fold start test_all
cd build
ctest test --output-on-failure
travis_fold end test_all
# Check correctness of build types
echo "Checking correctness of build types"
case "$CONFIG" in
DefaultDebug*)
./bin/storm --version | grep "with flags .* -g" || (echo "Error: Missing flag '-g' for debug build." && return 1)
;;
DefaultRelease*)
./bin/storm --version | grep "with flags .* -O3" || (echo "Error: Missing flag '-O3' for release build." && return 1)
./bin/storm --version | grep "with flags .* -DNDEBUG" || (echo "Error: Missing flag '-DNDEBUG' for release build." && return 1)
;;
*)
echo "Unrecognized value of CONFIG: $CONFIG"
exit 1
esac
cd ..
fi
if [[ "$TASK" == *Doxygen* ]]
then
# Generate doxygen doc
travis_fold start make_doc
cd build
make -j$N_JOBS doc
# Disable jekyll as otherwise files with starting underscore are not published
echo "" > doc/html/.nojekyll
cd ..
travis_fold end make_doc
fi
;;
*)
echo "Unrecognized value of run: $1"
exit 1
esac
}
# This only exists in OS X, but it doesn't cause issues in Linux (the dir doesn't exist, so it's
# ignored).
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
case $COMPILER in
gcc-6)
export CC=gcc-6
export CXX=g++-6
;;
gcc)
export CC=gcc
export CXX=g++
;;
clang-4)
case "$OS" in
linux)
export CC=clang-4.0
export CXX=clang++-4.0
;;
osx)
export CC=/usr/local/opt/llvm/bin/clang-4.0
export CXX=/usr/local/opt/llvm/bin/clang++
;;
*) echo "Error: unexpected OS: $OS"; exit 1 ;;
esac
;;
clang)
export CC=clang
export CXX=clang++
;;
*)
echo "Unrecognized value of COMPILER: $COMPILER"
exit 1
esac
# Build
echo CXX version: $($CXX --version)
echo C++ Standard library location: $(echo '#include <vector>' | $CXX -x c++ -E - | grep 'vector\"' | awk '{print $3}' | sed 's@/vector@@;s@\"@@g' | head -n 1)
echo Normalized C++ Standard library location: $(readlink -f $(echo '#include <vector>' | $CXX -x c++ -E - | grep 'vector\"' | awk '{print $3}' | sed 's@/vector@@;s@\"@@g' | head -n 1))
case "$CONFIG" in
DefaultDebug*)
CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DSTORM_DEVELOPER=ON -DSTORM_PORTABLE=ON -DCMAKE_CXX_FLAGS="$STLARG")
;;
DefaultRelease*)
CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DSTORM_DEVELOPER=OFF -DSTORM_PORTABLE=ON -DCMAKE_CXX_FLAGS="$STLARG")
;;
*)
echo "Unrecognized value of CONFIG: $CONFIG"; exit 1
;;
esac
# Restore timestamps of files
travis_fold start mtime
if [[ "$1" == "Build1" ]]
then
# Remove old mtime cache
rm -rf travis/mtime_cache/cache.json
fi
ruby travis/mtime_cache/mtime_cache.rb -g travis/mtime_cache/globs.txt -c travis/mtime_cache/cache.json
travis_fold end mtime
# Run and print output to avoid travis timeout
bell &
bellPID=$!
trap 'rc=$?; kill $bellPID; exit $rc' EXIT
run "$1"

48
travis/deploy_docker.sh

@ -1,48 +0,0 @@
#!/bin/bash -x
set -e
OS=$TRAVIS_OS_NAME
# Do not deploy if credentials are not given
if [ "${TRAVIS_SECURE_ENV_VARS}" == "false" ]; then
echo "WARNING: Not deploying as no credentials are given."
exit 0;
fi
# Do not deploy for pull requests
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
exit 0;
fi
echo "Deploying $1 to Dockerhub"
case $OS in
linux)
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Deploy as debug/release
case "$CONFIG" in
*DebugTravis)
docker commit $1 movesrwth/$1:travis-debug
docker push movesrwth/$1:travis-debug
;;
*ReleaseTravis)
docker commit $1 movesrwth/$1:travis
docker push movesrwth/$1:travis
;;
*)
echo "Unrecognized value of CONFIG: $CONFIG"; exit 1
;;
esac
;;
osx)
echo "Docker deployment on Mac OSX not used."
exit 1
;;
*)
# Unknown OS
echo "Unsupported OS: $OS"
exit 1
esac

155
travis/generate_travis.py

@ -1,155 +0,0 @@
# Generate .travis.yml automatically
# Configuration for Linux
configs = [
# OS, OS version, compiler, build type, task
("ubuntu", "18.04", "gcc", "DefaultDebug", "Test"),
("ubuntu", "18.04", "gcc", "DefaultRelease", "Test"),
("debian", "9", "gcc", "DefaultDebug", "Test"),
("debian", "9", "gcc", "DefaultRelease", "Test"),
("debian", "10", "gcc", "DefaultDebug", "Test"),
("debian", "10", "gcc", "DefaultRelease", "Test"),
("ubuntu", "20.04", "gcc", "DefaultDebugTravis", "TestDocker"),
("ubuntu", "20.04", "gcc", "DefaultReleaseTravis", "TestDockerDoxygen"),
# ("osx", "xcode9.3", "clang", "DefaultDebug", "Test"),
# ("osx", "xcode9.3", "clang", "DefaultRelease", "Test"),
]
# Stages in travis
build_stages = [
("Build (1st run)", "Build1"),
("Build (2nd run)", "Build2"),
("Build (3rd run)", "BuildLast"),
("Tasks", "Tasks"),
]
def get_env_string(os, os_version, compiler, build_type, task):
if os == "osx":
return "CONFIG={} TASK={} COMPILER={} STL=libc++\n".format(build_type, task, compiler)
else:
return "CONFIG={} TASK={} LINUX={} COMPILER={}\n".format(build_type, task, "{}-{}".format(os, os_version), compiler)
if __name__ == "__main__":
s = ""
# Initial config
s += "#\n"
s += "# General config\n"
s += "#\n"
s += "branches:\n"
s += " only:\n"
s += " - master\n"
s += " - stable\n"
s += "sudo: required\n"
s += "language: cpp\n"
s += "\n"
s += "git:\n"
s += " depth: false\n"
s += "\n"
s += "# Enable caching\n"
s += "cache:\n"
s += " timeout: 1000\n"
s += " directories:\n"
s += " - build\n"
s += " - travis/mtime_cache\n"
s += "\n"
s += "# Enable docker support\n"
s += "services:\n"
s += "- docker\n"
s += "\n"
s += "notifications:\n"
s += " email:\n"
s += " on_failure: always\n"
s += " on_success: change\n"
s += " recipients:\n"
s += ' - secure: "VWnsiQkt1xjgRo1hfNiNQqvLSr0fshFmLV7jJlUixhCr094mgD0U2bNKdUfebm28Byg9UyDYPbOFDC0sx7KydKiL1q7FKKXkyZH0k04wUu8XiNw+fYkDpmPnQs7G2n8oJ/GFJnr1Wp/1KI3qX5LX3xot4cJfx1I5iFC2O+p+ng6v/oSX+pewlMv4i7KL16ftHHHMo80N694v3g4B2NByn4GU2/bjVQcqlBp/TiVaUa5Nqu9DxZi/n9CJqGEaRHOblWyMO3EyTZsn45BNSWeQ3DtnMwZ73rlIr9CaEgCeuArc6RGghUAVqRI5ao+N5apekIaILwTgL6AJn+Lw/+NRPa8xclgd0rKqUQJMJCDZKjKz2lmIs3bxfELOizxJ3FJQ5R95FAxeAZ6rb/j40YqVVTw2IMBDnEE0J5ZmpUYNUtPti/Adf6GD9Fb2y8sLo0XDJzkI8OxYhfgjSy5KYmRj8O5MXcP2MAE8LQauNO3MaFnL9VMVOTZePJrPozQUgM021uyahf960+QNI06Uqlmg+PwWkSdllQlxHHplOgW7zClFhtSUpnJxcsUBzgg4kVg80gXUwAQkaDi7A9Wh2bs+TvMlmHzBwg+2SaAfWDgjeJIeOaipDkF1uSGzC+EHAiiKYMLd4Aahoi8SuelJUucoyJyLAq00WdUFQIh/izVhM4Y="\n'
s += "\n"
s += "#\n"
s += "# Configurations\n"
s += "#\n"
s += "jobs:\n"
s += " include:\n"
# Start with prebuilding carl for docker
s += "\n"
s += " ###\n"
s += " # Stage: Build Carl\n"
s += " ###\n"
for config in configs:
os, os_version, compiler, build_type, task = config
os_type = "osx" if os == "osx" else "linux"
if "Travis" in build_type:
s += " # {}-{} - {}\n".format(os, os_version, build_type)
buildConfig = ""
buildConfig += " - stage: Build Carl\n"
buildConfig += " os: {}\n".format(os_type)
buildConfig += " compiler: {}\n".format(compiler)
buildConfig += " env: {}".format(get_env_string(os, os_version, compiler, build_type, task))
buildConfig += " before_script:\n"
buildConfig += ' - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode\n'
buildConfig += " script:\n"
buildConfig += " - travis/build_carl.sh\n"
buildConfig += " before_cache:\n"
buildConfig += " - docker cp carl:/opt/carl/. .\n"
# Upload to DockerHub
buildConfig += " deploy:\n"
buildConfig += " - provider: script\n"
buildConfig += " skip_cleanup: true\n"
buildConfig += " script: bash travis/deploy_docker.sh carl\n"
s += buildConfig
# Generate all build configurations
for stage in build_stages:
s += "\n"
s += " ###\n"
s += " # Stage: {}\n".format(stage[0])
s += " ###\n"
for config in configs:
os, os_version, compiler, build_type, task = config
os_type = "osx" if os == "osx" else "linux"
s += " # {}-{} - {}\n".format(os, os_version, build_type)
buildConfig = ""
buildConfig += " - stage: {}\n".format(stage[0])
buildConfig += " os: {}\n".format(os_type)
if os_type == "osx":
buildConfig += " osx_image: {}\n".format(os_version)
buildConfig += " compiler: {}\n".format(compiler)
buildConfig += " env: {}".format(get_env_string(os, os_version, compiler, build_type, task))
buildConfig += " install:\n"
if stage[1] == "Build1":
buildConfig += " - rm -rf build\n"
buildConfig += " - travis/skip_test.sh\n"
if os_type == "osx":
buildConfig += " - travis/install_osx.sh\n"
buildConfig += " before_script:\n"
buildConfig += ' - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode\n'
buildConfig += " script:\n"
buildConfig += " - travis/build.sh {}\n".format(stage[1])
if os_type == "linux":
buildConfig += " before_cache:\n"
buildConfig += " - docker cp storm:/opt/storm/. .\n"
buildConfig += " after_failure:\n"
buildConfig += " - find build -iname '*err*.log' -type f -print -exec cat {} \;\n"
# Deployment
if stage[1] == "Tasks":
if "Docker" in task or "Doxygen" in task:
buildConfig += " deploy:\n"
if "Docker" in task:
buildConfig += " - provider: script\n"
buildConfig += " skip_cleanup: true\n"
buildConfig += " script: bash travis/deploy_docker.sh storm\n"
if "Doxygen" in task:
buildConfig += " - provider: pages\n"
buildConfig += " skip_cleanup: true\n"
buildConfig += " github_token: $GITHUB_TOKEN\n"
buildConfig += " local_dir: build/doc/html/\n"
buildConfig += " repo: moves-rwth/storm-doc\n"
buildConfig += " target_branch: master\n"
buildConfig += " on:\n"
buildConfig += " branch: master\n"
s += buildConfig
print(s)

66
travis/install_osx.sh

@ -1,66 +0,0 @@
#!/bin/bash
# Script installing dependencies
# Inspired by https://github.com/google/fruit
set -e
# Helper for travis folding
travis_fold() {
local action=$1
local name=$2
echo -en "travis_fold:${action}:${name}\r"
}
# Helper for installing packages via homebrew
install_brew_package() {
if brew list -1 | grep -q "^$1\$"; then
# Package is installed, upgrade if needed
brew outdated "$1" || brew upgrade "$@"
else
# Package not installed yet, install.
brew install "$@" || brew link --overwrite "$@"
fi
}
# Skip this run?
if [ -f build/skip.txt ]
then
exit 0
fi
# Update packages
travis_fold start brew_update
brew update
travis_fold end brew_update
travis_fold start brew_install_util
# For md5sum
install_brew_package md5sha1sum
# For `timeout'
install_brew_package coreutils
install_brew_package cmake
# Install compiler
case "${COMPILER}" in
gcc) install_brew_package gcc ;;
gcc-6) install_brew_package gcc@6 ;;
clang) ;;
clang-4) install_brew_package llvm@4 --with-clang --with-libcxx;;
*) echo "Compiler not supported: ${COMPILER}. See travis/install_osx.sh"; exit 1 ;;
esac
travis_fold end brew_install_util
# Install dependencies
travis_fold start brew_install_dependencies
install_brew_package gmp --c++11
install_brew_package cln
install_brew_package ginac
install_brew_package doxygen
install_brew_package boost --c++11
install_brew_package z3 # optional
install_brew_package glpk
install_brew_package hwloc
install_brew_package eigen
travis_fold end brew_install_dependencies

8
travis/mtime_cache/globs.txt

@ -1,8 +0,0 @@
src/**/*.{%{cpp}}
src/**/*.{in}
src/**/CMakeLists.txt
CMakeLists.txt
*.{in}
resources/3rdparty/**/*.{%{cpp}}
resources/3rdparty/eigen-3.3-beta1/StormEigen/**/*
resources/3rdparty/eigen-3.3-beta1/unsupported/**/*

178
travis/mtime_cache/mtime_cache.rb

@ -1,178 +0,0 @@
#!/usr/bin/env ruby
#
# mtime_cache
# Copyright (c) 2016 Borislav Stanimirov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
require 'digest/md5'
require 'json'
require 'fileutils'
VERSION = "1.0.2"
VERSION_TEXT = "mtime_cache v#{VERSION}"
USAGE = <<ENDUSAGE
Usage:
mtime_cache [<globs>] [-g globfile] [-d] [-q|V] [-c cache]
ENDUSAGE
HELP = <<ENDHELP
Traverse through globbed files, making a json cache based on their mtime.
If a cache exists, changes the mtime of existing unchanged (based on MD5
hash) files to the one in the cache.
Options:
globs Ruby-compatible glob strings (ex some/path/**/*.java)
A extension pattern is allowd in the form %{pattern}
(ex some/path/*.{%{pattern1},%{pattern2}})
The globs support the following patterns:
%{cpp} - common C++ extensions
-g, --globfile A file with list of globs to perform (one per line)
-?, -h, --help Show this help message.
-v, --version Show the version number (#{VERSION})
-q, --quiet Don't log anything to stdout
-V, --verbose Show extra logging
-d, --dryrun Don't change any files on the filesystem
-c, --cache Specify the cache file for input and output.
[Default is .mtime_cache.json]
ENDHELP
param_arg = nil
ARGS = { :cache => '.mtime_cache.json', :globs => [] }
ARGV.each do |arg|
case arg
when '-g', '--globfile' then param_arg = :globfile
when '-h', '-?', '--help' then ARGS[:help] = true
when '-v', '--version' then ARGS[:ver] = true
when '-q', '--quiet' then ARGS[:quiet] = true
when '-V', '--verbose' then ARGS[:verbose] = true
when '-d', '--dryrun' then ARGS[:dry] = true
when '-c', '--cache' then param_arg = :cache
else
if param_arg
ARGS[param_arg] = arg
param_arg = nil
else
ARGS[:globs] << arg
end
end
end
def log(text, level = 0)
return if ARGS[:quiet]
return if level > 0 && !ARGS[:verbose]
puts text
end
if ARGS[:ver] || ARGS[:help]
log VERSION_TEXT
exit if ARGS[:ver]
log USAGE
log HELP
exit
end
if ARGS[:globs].empty? && !ARGS[:globfile]
log 'Error: Missing globs'
log USAGE
exit 1
end
EXTENSION_PATTERNS = {
:cpp => "c,cc,cpp,cxx,h,hpp,hxx,inl,ipp,inc,ixx"
}
cache_file = ARGS[:cache]
cache = {}
if File.file?(cache_file)
log "Found #{cache_file}"
cache = JSON.parse(File.read(cache_file))
log "Read #{cache.length} entries"
else
log "#{cache_file} not found. A new one will be created"
end
globs = ARGS[:globs].map { |g| g % EXTENSION_PATTERNS }
globfile = ARGS[:globfile]
if globfile
File.open(globfile, 'r').each_line do |line|
line.strip!
next if line.empty?
globs << line % EXTENSION_PATTERNS
end
end
if globs.empty?
log 'Error: No globs in globfile'
log USAGE
exit 1
end
files = {}
num_changed = 0
globs.each do |glob|
Dir[glob].each do |file|
next if !File.file?(file)
mtime = File.mtime(file).to_i
hash = Digest::MD5.hexdigest(File.read(file))
cached = cache[file]
if cached && cached['hash'] == hash && cached['mtime'] < mtime
mtime = cached['mtime']
log "mtime_cache: changing mtime of #{file} to #{mtime}", 1
File.utime(File.atime(file), Time.at(mtime), file) if !ARGS[:dry]
num_changed += 1
else
log "mtime_cache: NOT changing mtime of #{file}", 1
end
files[file] = { 'mtime' => mtime, 'hash' => hash }
end
end
log "Changed mtime of #{num_changed} of #{files.length} files"
log "Writing #{cache_file}"
if !ARGS[:dry]
dirname = File.dirname(cache_file)
unless File.directory?(dirname)
FileUtils.mkdir_p(dirname)
end
File.open(cache_file, 'w').write(JSON.pretty_generate(files))
end

6
travis/skip_test.sh

@ -1,6 +0,0 @@
#!/bin/bash
# Skip this run?
if [ -f build/skip.txt ]
then
exit 0
fi
Loading…
Cancel
Save