Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

125 wiersze
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. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  50. - uses: actions/setup-node@v3
  51. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  52. with:
  53. node-version: 16
  54. check-latest: true
  55. - name: Add to Hosts
  56. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  57. run: |
  58. echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
  59. echo "127.0.0.1 test_site_producer" | sudo tee -a /etc/hosts
  60. - name: Cache pip
  61. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  62. uses: actions/cache@v3
  63. with:
  64. path: ~/.cache/pip
  65. key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py') }}
  66. restore-keys: |
  67. ${{ runner.os }}-pip-
  68. ${{ runner.os }}-
  69. - name: Cache node modules
  70. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  71. uses: actions/cache@v3
  72. env:
  73. cache-name: cache-node-modules
  74. with:
  75. path: ~/.npm
  76. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
  77. restore-keys: |
  78. ${{ runner.os }}-build-${{ env.cache-name }}-
  79. ${{ runner.os }}-build-
  80. ${{ runner.os }}-
  81. - name: Get yarn cache directory path
  82. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  83. id: yarn-cache-dir-path
  84. run: echo "::set-output name=dir::$(yarn cache dir)"
  85. - uses: actions/cache@v3
  86. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  87. id: yarn-cache
  88. with:
  89. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  90. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  91. restore-keys: |
  92. ${{ runner.os }}-yarn-
  93. - name: Install Dependencies
  94. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  95. run: |
  96. bash ${GITHUB_WORKSPACE}/.github/helper/install_dependencies.sh
  97. bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
  98. env:
  99. BEFORE: ${{ env.GITHUB_EVENT_PATH.before }}
  100. AFTER: ${{ env.GITHUB_EVENT_PATH.after }}
  101. TYPE: server
  102. DB: mariadb
  103. - name: Run Tests
  104. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  105. run: cd ~/xhiveframework-bench/ && bench --site test_site run-parallel-tests