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.
 
 
 
 
 
 

124 lines
3.7 KiB

  1. name: Server (MariaDB)
  2. on:
  3. pull_request:
  4. workflow_dispatch:
  5. push:
  6. branches: [ develop ]
  7. concurrency:
  8. group: server-mariadb-develop-${{ github.event.number }}
  9. cancel-in-progress: true
  10. permissions:
  11. contents: read
  12. jobs:
  13. test:
  14. name: Unit Tests
  15. runs-on: ubuntu-latest
  16. timeout-minutes: 60
  17. strategy:
  18. fail-fast: false
  19. services:
  20. mariadb:
  21. image: mariadb:10.6
  22. env:
  23. MARIADB_ROOT_PASSWORD: travis
  24. ports:
  25. - 3306:3306
  26. options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
  27. steps:
  28. - name: Clone
  29. uses: actions/checkout@v3
  30. - name: Setup Python
  31. uses: actions/setup-python@v4
  32. with:
  33. python-version: '3.10'
  34. - name: Check for valid Python & Merge Conflicts
  35. run: |
  36. python -m compileall -f "${GITHUB_WORKSPACE}"
  37. if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
  38. then echo "Found merge conflicts"
  39. exit 1
  40. fi
  41. - name: Check if build should be run
  42. id: check-build
  43. run: |
  44. python "${GITHUB_WORKSPACE}/.github/helper/roulette.py"
  45. env:
  46. TYPE: "server"
  47. PR_NUMBER: ${{ github.event.number }}
  48. REPO_NAME: ${{ github.repository }}
  49. - uses: actions/setup-node@v3
  50. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  51. with:
  52. node-version: 16
  53. check-latest: true
  54. - name: Add to Hosts
  55. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  56. run: |
  57. echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
  58. echo "127.0.0.1 test_site_producer" | sudo tee -a /etc/hosts
  59. - name: Cache pip
  60. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  61. uses: actions/cache@v3
  62. with:
  63. path: ~/.cache/pip
  64. key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py') }}
  65. restore-keys: |
  66. ${{ runner.os }}-pip-
  67. ${{ runner.os }}-
  68. - name: Cache node modules
  69. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  70. uses: actions/cache@v3
  71. env:
  72. cache-name: cache-node-modules
  73. with:
  74. path: ~/.npm
  75. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
  76. restore-keys: |
  77. ${{ runner.os }}-build-${{ env.cache-name }}-
  78. ${{ runner.os }}-build-
  79. ${{ runner.os }}-
  80. - name: Get yarn cache directory path
  81. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  82. id: yarn-cache-dir-path
  83. run: echo "::set-output name=dir::$(yarn cache dir)"
  84. - uses: actions/cache@v3
  85. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  86. id: yarn-cache
  87. with:
  88. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  89. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  90. restore-keys: |
  91. ${{ runner.os }}-yarn-
  92. - name: Install Dependencies
  93. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  94. run: |
  95. bash ${GITHUB_WORKSPACE}/.github/helper/install_dependencies.sh
  96. bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
  97. env:
  98. BEFORE: ${{ env.GITHUB_EVENT_PATH.before }}
  99. AFTER: ${{ env.GITHUB_EVENT_PATH.after }}
  100. TYPE: server
  101. DB: mariadb
  102. - name: Run Tests
  103. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  104. run: cd ~/influxframework-bench/ && bench --site test_site run-parallel-tests