Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

148 righe
4.8 KiB

  1. name: Server (MariaDB)
  2. on:
  3. pull_request:
  4. workflow_dispatch:
  5. concurrency:
  6. group: patch-mariadb-develop-${{ github.event.number }}
  7. cancel-in-progress: true
  8. permissions:
  9. contents: read
  10. jobs:
  11. test:
  12. name: Patch
  13. runs-on: ubuntu-latest
  14. timeout-minutes: 60
  15. services:
  16. mariadb:
  17. image: mariadb:10.6
  18. env:
  19. MARIADB_ROOT_PASSWORD: travis
  20. ports:
  21. - 3306:3306
  22. options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
  23. steps:
  24. - name: Clone
  25. uses: actions/checkout@v3
  26. - name: Check for valid Python & Merge Conflicts
  27. run: |
  28. python -m compileall -f "${GITHUB_WORKSPACE}"
  29. if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
  30. then echo "Found merge conflicts"
  31. exit 1
  32. fi
  33. - name: Check if build should be run
  34. id: check-build
  35. run: |
  36. python "${GITHUB_WORKSPACE}/.github/helper/roulette.py"
  37. env:
  38. TYPE: "server"
  39. PR_NUMBER: ${{ github.event.number }}
  40. REPO_NAME: ${{ github.repository }}
  41. - name: Setup Python
  42. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  43. uses: "gabrielfalcao/pyenv-action@v10"
  44. with:
  45. versions: 3.10:latest, 3.7:latest
  46. - name: Setup Node
  47. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  48. uses: actions/setup-node@v3
  49. with:
  50. node-version: 16
  51. check-latest: true
  52. - name: Add to Hosts
  53. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  54. run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
  55. - name: Cache pip
  56. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  57. uses: actions/cache@v3
  58. with:
  59. path: ~/.cache/pip
  60. key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py') }}
  61. restore-keys: |
  62. ${{ runner.os }}-pip-
  63. ${{ runner.os }}-
  64. - name: Cache node modules
  65. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  66. uses: actions/cache@v3
  67. env:
  68. cache-name: cache-node-modules
  69. with:
  70. path: ~/.npm
  71. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
  72. restore-keys: |
  73. ${{ runner.os }}-build-${{ env.cache-name }}-
  74. ${{ runner.os }}-build-
  75. ${{ runner.os }}-
  76. - name: Get yarn cache directory path
  77. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  78. id: yarn-cache-dir-path
  79. run: echo "::set-output name=dir::$(yarn cache dir)"
  80. - uses: actions/cache@v3
  81. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  82. id: yarn-cache
  83. with:
  84. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  85. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  86. restore-keys: |
  87. ${{ runner.os }}-yarn-
  88. - name: Install Dependencies
  89. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  90. run: |
  91. bash ${GITHUB_WORKSPACE}/.github/helper/install_dependencies.sh
  92. pip install influxframework-bench
  93. pyenv global $(pyenv versions | grep '3.10')
  94. bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
  95. env:
  96. BEFORE: ${{ env.GITHUB_EVENT_PATH.before }}
  97. AFTER: ${{ env.GITHUB_EVENT_PATH.after }}
  98. TYPE: server
  99. DB: mariadb
  100. - name: Run Patch Tests
  101. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  102. run: |
  103. cd ~/influxframework-bench/
  104. wget https://influxframework.com/files/v10-influxframework.sql.gz
  105. bench --site test_site --force restore ~/influxframework-bench/v10-influxframework.sql.gz
  106. source env/bin/activate
  107. cd apps/influxframework/
  108. git remote set-url upstream https://github.com/influxframework/influxframework.git
  109. pyenv global $(pyenv versions | grep '3.7')
  110. for version in $(seq 12 13)
  111. do
  112. echo "Updating to v$version"
  113. branch_name="version-$version-hotfix"
  114. git fetch --depth 1 upstream $branch_name:$branch_name
  115. git checkout -q -f $branch_name
  116. pip install -U influxframework-bench
  117. rm -rf ~/influxframework-bench/env
  118. bench -v setup env
  119. bench --site test_site migrate
  120. done
  121. echo "Updating to last commit"
  122. git checkout -q -f "$GITHUB_SHA"
  123. pyenv global $(pyenv versions | grep '3.10')
  124. rm -rf ~/influxframework-bench/env
  125. bench -v setup env
  126. bench --site test_site migrate