25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

133 satır
3.9 KiB

  1. name: Server
  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. jobs:
  11. test:
  12. runs-on: ubuntu-latest
  13. timeout-minutes: 60
  14. strategy:
  15. fail-fast: false
  16. matrix:
  17. container: [1, 2]
  18. name: Python Unit Tests (MariaDB)
  19. services:
  20. mysql:
  21. image: mariadb:10.3
  22. env:
  23. MYSQL_ALLOW_EMPTY_PASSWORD: YES
  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@v2
  30. - name: Setup Python
  31. uses: actions/setup-python@v2
  32. with:
  33. python-version: '3.9'
  34. - name: Check if build should be run
  35. id: check-build
  36. run: |
  37. python "${GITHUB_WORKSPACE}/.github/helper/roulette.py"
  38. env:
  39. TYPE: "server"
  40. PR_NUMBER: ${{ github.event.number }}
  41. REPO_NAME: ${{ github.repository }}
  42. - uses: actions/setup-node@v2
  43. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  44. with:
  45. node-version: 14
  46. check-latest: true
  47. - name: Add to Hosts
  48. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  49. run: |
  50. echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
  51. echo "127.0.0.1 test_site_producer" | sudo tee -a /etc/hosts
  52. - name: Cache pip
  53. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  54. uses: actions/cache@v2
  55. with:
  56. path: ~/.cache/pip
  57. key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
  58. restore-keys: |
  59. ${{ runner.os }}-pip-
  60. ${{ runner.os }}-
  61. - name: Cache node modules
  62. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  63. uses: actions/cache@v2
  64. env:
  65. cache-name: cache-node-modules
  66. with:
  67. path: ~/.npm
  68. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
  69. restore-keys: |
  70. ${{ runner.os }}-build-${{ env.cache-name }}-
  71. ${{ runner.os }}-build-
  72. ${{ runner.os }}-
  73. - name: Get yarn cache directory path
  74. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  75. id: yarn-cache-dir-path
  76. run: echo "::set-output name=dir::$(yarn cache dir)"
  77. - uses: actions/cache@v2
  78. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  79. id: yarn-cache
  80. with:
  81. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  82. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  83. restore-keys: |
  84. ${{ runner.os }}-yarn-
  85. - name: Install Dependencies
  86. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  87. run: bash ${GITHUB_WORKSPACE}/.github/helper/install_dependencies.sh
  88. env:
  89. BEFORE: ${{ env.GITHUB_EVENT_PATH.before }}
  90. AFTER: ${{ env.GITHUB_EVENT_PATH.after }}
  91. TYPE: server
  92. - name: Install
  93. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  94. run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
  95. env:
  96. DB: mariadb
  97. TYPE: server
  98. - name: Run Tests
  99. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  100. run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --use-orchestrator --with-coverage
  101. env:
  102. CI_BUILD_ID: ${{ github.run_id }}
  103. ORCHESTRATOR_URL: http://test-orchestrator.frappe.io
  104. - name: Upload coverage data
  105. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  106. uses: codecov/codecov-action@v2
  107. with:
  108. name: MariaDB
  109. fail_ci_if_error: true
  110. files: /home/runner/frappe-bench/sites/coverage.xml
  111. verbose: true
  112. flags: server