ubuntu-latest&gcc-4.9.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. name: ubuntu-latest&gcc-4.9
  2. on:
  3. push:
  4. pull_request:
  5. env:
  6. CC: gcc-4.9
  7. CXX: g++-4.9
  8. secret_account: ${{ secrets.DOCKER_USERNAME }}
  9. jobs:
  10. build:
  11. # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
  12. # You can convert this to a matrix build if you need cross-platform coverage.
  13. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  14. runs-on: ubuntu-latest
  15. services:
  16. mysql:
  17. image: mysql
  18. ports:
  19. - 3306:3306
  20. env:
  21. MYSQL_ROOT_PASSWORD: 123456
  22. options: --name "mysql"
  23. steps:
  24. - uses: actions/checkout@v3
  25. - name: install gcc env
  26. run: |
  27. echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main" | sudo tee -a /etc/apt/sources.list
  28. echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe" | sudo tee -a /etc/apt/sources.list
  29. sudo apt update
  30. sudo apt install gcc-4.9 g++-4.9
  31. shell: bash
  32. - name: Set up Python 3.7
  33. uses: actions/setup-python@v2
  34. with:
  35. python-version: "3.7"
  36. - name: install dependency
  37. run: |
  38. sudo apt-get install -y make zlib1g zlib1g-dev bzip2 liblz4-dev libasan0 openssl libmxml-dev
  39. python -m pip install --upgrade pip
  40. pip install pytest
  41. - name: cmake project
  42. run: |
  43. cd ${{github.workspace}}
  44. mkdir build
  45. cd build
  46. cmake ../
  47. make
  48. - name: login docker hub
  49. if: ${{ env.secret_account != '' }}
  50. uses: docker/login-action@v2
  51. with:
  52. username: ${{ secrets.DOCKER_USERNAME }}
  53. password: ${{ secrets.DOCKER_PASSWORD }}
  54. - name: publish devel CacheOnly docker
  55. if: ${{ env.secret_account != '' }}
  56. run: |
  57. cd ${{github.workspace}}
  58. cp dockerfiles/devel/dtc.cacheonly.yaml dockerfiles/devel/dtc.yaml
  59. cp conf/log4cplus.conf dockerfiles/devel/
  60. cp build/src/core/dtcd dockerfiles/devel/
  61. cp build/src/agent/dtcagent dockerfiles/devel/
  62. cp build/src/agent-watchdog/agent-watchdog dockerfiles/devel/
  63. cp build/src/complex/async-connector dockerfiles/devel/
  64. cp build/src/connector/connector dockerfiles/devel/
  65. cp build/src/data_lifecycle/data_lifecycle_manager dockerfiles/devel/
  66. cp build/src/hwcserver/hwcserver dockerfiles/devel/
  67. cd dockerfiles/devel/
  68. docker build -t ${{ secrets.DOCKER_USERNAME }}/devel:CacheOnly .
  69. docker push ${{ secrets.DOCKER_USERNAME }}/devel:CacheOnly
  70. - name: publish devel Cache with Database docker
  71. if: ${{ env.secret_account != '' }}
  72. run: |
  73. cd ${{github.workspace}}
  74. cp -f dockerfiles/devel/dtc.dbaddition.yaml dockerfiles/devel/dtc.yaml
  75. cd dockerfiles/devel/
  76. docker build -t ${{ secrets.DOCKER_USERNAME }}/devel:CacheWithDB .
  77. docker push ${{ secrets.DOCKER_USERNAME }}/devel:CacheWithDB
  78. - name: publish devel Layered docker
  79. if: ${{ env.secret_account != '' }}
  80. run: |
  81. cd ${{github.workspace}}
  82. cp -f dockerfiles/devel/dtc.layered.yaml dockerfiles/devel/dtc.yaml
  83. cd dockerfiles/devel/
  84. docker build -t ${{ secrets.DOCKER_USERNAME }}/devel:Layered .
  85. docker push ${{ secrets.DOCKER_USERNAME }}/devel:Layered
  86. - name: init db table
  87. if: ${{ env.secret_account != '' }}
  88. run: |
  89. mysql -h127.0.0.1 -uroot -p123456 -e "create database layer2;"
  90. mysql -h127.0.0.1 -uroot -p123456 -e "show databases;"
  91. mysql -h127.0.0.1 -uroot -p123456 -Dlayer2 -e "source ${{github.workspace}}/script/init_table.sql;"
  92. mysql -h127.0.0.1 -uroot -p123456 -Dlayer2 -e "show tables;"
  93. - name: Testing CacheOnly
  94. run: |
  95. cd ${{github.workspace}}/tests
  96. pytest