You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
6.7 KiB

  1. name: Build Test
  2. # Builds and tests storm on varius platforms
  3. # also deploys images to dockerhub
  4. on:
  5. schedule:
  6. # run daily
  7. - cron: '0 6 * * *'
  8. # needed to trigger the workflow manually
  9. workflow_dispatch:
  10. env:
  11. CARL_BRANCH: "master14"
  12. CARL_GIT_URL: "https://github.com/smtrat/carl.git"
  13. STORM_GIT_URL: "${{ github.server_url }}/${{ github.repository }}.git"
  14. STORM_BRANCH: "master"
  15. # github runners currently have two cores
  16. NR_JOBS: "2"
  17. # cmake arguments
  18. CMAKE_DEBUG: "-DCMAKE_BUILD_TYPE=Debug -DSTORM_DEVELOPER=ON -DSTORM_PORTABLE=ON"
  19. CMAKE_RELEASE: "-DCMAKE_BUILD_TYPE=Release -DSTORM_DEVELOPER=OFF -DSTORM_PORTABLE=ON"
  20. CARL_CMAKE_DEBUG: "-DCMAKE_BUILD_TYPE=Debug -DUSE_CLN_NUMBERS=ON -DUSE_GINAC=ON -DTHREAD_SAFE=ON -DBUILD_ADDONS=ON -DBUILD_ADDON_PARSER=ON"
  21. CARL_CMAKE_RELEASE: "-DCMAKE_BUILD_TYPE=Release -DUSE_CLN_NUMBERS=ON -DUSE_GINAC=ON -DTHREAD_SAFE=ON -DBUILD_ADDONS=ON -DBUILD_ADDON_PARSER=ON"
  22. jobs:
  23. noDeploy:
  24. runs-on: ubuntu-latest
  25. strategy:
  26. matrix:
  27. distro: ["ubuntu-18.04", "debian-10", "debian-9"]
  28. debugOrRelease: ["debug", "release"]
  29. steps:
  30. - name: Setup cmake arguments
  31. # this is strangely the best way to implement environment variables based on the value of another
  32. # GITHUB_ENV is a magic variable pointing to a file; if a line with format {NAME}={VALUE}
  33. # then the env variable with name NAME will be created/updated with VALUE
  34. run: |
  35. ([[ ${{ matrix.debugOrRelease }} == "debug" ]] && echo "CMAKE_ARGS=${CMAKE_DEBUG}" || echo "CMAKE_ARGS=${CMAKE_RELEASE}") >> $GITHUB_ENV
  36. - name: Init Docker
  37. run: sudo docker run -d -it --name storm --privileged movesrwth/storm-basesystem:${{ matrix.distro }}
  38. - name: Git clone
  39. run: sudo docker exec storm git clone --depth 1 --branch $STORM_BRANCH $STORM_GIT_URL /opt/storm
  40. - name: Run cmake
  41. run: sudo docker exec storm bash -c "mkdir /opt/storm/build; cd /opt/storm/build; cmake .. ${CMAKE_ARGS}"
  42. - name: Build storm
  43. run: sudo docker exec storm bash -c "cd /opt/storm/build; make -j ${NR_JOBS}"
  44. # A bit hacky... but its usefullnes has been proven in production
  45. - name: Check release makeflags
  46. if: matrix.debugOrRelease == 'release'
  47. run: |
  48. sudo docker exec storm bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -O3' || (echo \"Error: Missing flag \'-O3\' for release build.\" && false)"
  49. sudo docker exec storm bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -DNDEBUG' || (echo \"Error: Missing flag \'-DNDEBUG\' for release build.\" && false)"
  50. - name: Check debug makeflags
  51. if: matrix.debugOrRelease == 'debug'
  52. run: |
  53. sudo docker exec storm bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -g' || (echo \"Error: Missing flag \'-g\' for debug build.\" && false)"
  54. - name: Run unit tests
  55. run: sudo docker exec storm bash -c "cd /opt/storm/build; ctest test --output-on-failure"
  56. deploy:
  57. runs-on: ubuntu-latest
  58. env:
  59. DISTRO: "ubuntu-20.04"
  60. strategy:
  61. matrix:
  62. debugOrRelease: ["debug", "release"]
  63. steps:
  64. - name: Setup cmake arguments
  65. # this is strangely the best way to implement environment variables based on the value of another
  66. # GITHUB_ENV is a magic variable pointing to a file; if a line with format {NAME}={VALUE}
  67. # then the env variable with name NAME will be created/updated with VALUE
  68. run: |
  69. ([[ ${{ matrix.debugOrRelease }} == "debug" ]] && echo "CMAKE_ARGS=${CMAKE_DEBUG}" || echo "CMAKE_ARGS=${CMAKE_RELEASE}") >> $GITHUB_ENV
  70. ([[ ${{ matrix.debugOrRelease }} == "debug" ]] && echo "CARL_CMAKE_ARGS=${CARL_CMAKE_DEBUG}" || echo "CARL_CMAKE_ARGS=${CARL_CMAKE_RELEASE}") >> $GITHUB_ENV
  71. - name: Login into docker
  72. run: echo "${{ secrets.DOCKER_PASSWORD }}" | sudo docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
  73. - name: Init Docker
  74. run: sudo docker run -d -it --name storm --privileged movesrwth/storm-basesystem:${DISTRO}
  75. #####
  76. # Build & DEPLOY CARL
  77. #####
  78. # We should not do partial updates :/
  79. # but we need to install some dependencies
  80. # Surely we can find a better way to do this at some point
  81. - name: Update base system
  82. run: |
  83. sudo docker exec storm apt-get update
  84. sudo docker exec storm apt-get upgrade -qqy
  85. - name: install dependencies
  86. run: sudo docker exec storm apt-get install -qq -y uuid-dev pkg-config
  87. - name: Git clone carl
  88. run: sudo docker exec storm git clone --depth 1 --branch $CARL_BRANCH $CARL_GIT_URL /opt/carl
  89. - name: Run cmake for carl
  90. run: sudo docker exec storm bash -c "mkdir /opt/carl/build; cd /opt/carl/build; cmake .. ${CARL_CMAKE_ARGS}"
  91. - name: Build carl
  92. run: sudo docker exec storm bash -c "cd /opt/carl/build; make lib_carl -j ${NR_JOBS}"
  93. - name: Deploy carl
  94. run: |
  95. sudo docker commit storm movesrwth/carl:ci-${{ matrix.debugOrRelease }}
  96. sudo docker push movesrwth/carl:ci-${{ matrix.debugOrRelease }}
  97. #####
  98. # Build & TEST & DEPLOY STORM
  99. #####
  100. - name: Git clone
  101. run: sudo docker exec storm git clone --depth 1 --branch $STORM_BRANCH $STORM_GIT_URL /opt/storm
  102. - name: Run cmake
  103. run: sudo docker exec storm bash -c "mkdir /opt/storm/build; cd /opt/storm/build; cmake .. ${CMAKE_ARGS}"
  104. - name: Build storm
  105. run: sudo docker exec storm bash -c "cd /opt/storm/build; make -j ${NR_JOBS}"
  106. # A bit hacky... but its usefullnes has been proven in production
  107. - name: Check release makeflags
  108. if: matrix.debugOrRelease == 'release'
  109. run: |
  110. sudo docker exec storm bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -O3' || (echo \"Error: Missing flag \'-O3\' for release build.\" && false)"
  111. sudo docker exec storm bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -DNDEBUG' || (echo \"Error: Missing flag \'-DNDEBUG\' for release build.\" && false)"
  112. - name: Check debug makeflags
  113. if: matrix.debugOrRelease == 'debug'
  114. run: |
  115. sudo docker exec storm bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -g' || (echo \"Error: Missing flag \'-g\' for debug build.\" && false)"
  116. - name: Run unit tests
  117. run: sudo docker exec storm bash -c "cd /opt/storm/build; ctest test --output-on-failure"
  118. - name: Deploy storm
  119. run: |
  120. sudo docker commit storm movesrwth/storm:ci-${{ matrix.debugOrRelease }}
  121. sudo docker push movesrwth/storm:ci-${{ matrix.debugOrRelease }}