Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 

102 рядки
2.5 KiB

  1. name: CI
  2. on:
  3. push:
  4. branches:
  5. - develop
  6. pull_request:
  7. branches:
  8. - develop
  9. schedule:
  10. # Run everday at midnight UTC / 5:30 IST
  11. - cron: "0 0 * * *"
  12. concurrency:
  13. group: develop-${{ github.event.number }}
  14. cancel-in-progress: true
  15. jobs:
  16. tests:
  17. runs-on: ubuntu-latest
  18. timeout-minutes: 60
  19. strategy:
  20. fail-fast: false
  21. name: Server
  22. services:
  23. mysql:
  24. image: mariadb:10.3
  25. env:
  26. MYSQL_ALLOW_EMPTY_PASSWORD: YES
  27. ports:
  28. - 3306:3306
  29. options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
  30. steps:
  31. - name: Clone
  32. uses: actions/checkout@v2
  33. - name: Setup Python
  34. uses: actions/setup-python@v2
  35. with:
  36. python-version: '3.10'
  37. - name: Setup Node
  38. uses: actions/setup-node@v2
  39. with:
  40. node-version: 14
  41. check-latest: true
  42. - name: Add to Hosts
  43. run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
  44. - name: Cache pip
  45. uses: actions/cache@v2
  46. with:
  47. path: ~/.cache/pip
  48. key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt') }}
  49. restore-keys: |
  50. ${{ runner.os }}-pip-
  51. ${{ runner.os }}-
  52. - name: Cache node modules
  53. uses: actions/cache@v2
  54. env:
  55. cache-name: cache-node-modules
  56. with:
  57. path: ~/.npm
  58. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
  59. restore-keys: |
  60. ${{ runner.os }}-build-${{ env.cache-name }}-
  61. ${{ runner.os }}-build-
  62. ${{ runner.os }}-
  63. - name: Get yarn cache directory path
  64. id: yarn-cache-dir-path
  65. run: echo "::set-output name=dir::$(yarn cache dir)"
  66. - uses: actions/cache@v2
  67. id: yarn-cache
  68. with:
  69. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  70. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  71. restore-keys: |
  72. ${{ runner.os }}-yarn-
  73. - name: Install
  74. run: |
  75. bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
  76. - name: Run Tests
  77. run: cd ~/frappe-bench/ && bench --site test_site run-tests --app hrms --coverage
  78. env:
  79. TYPE: server
  80. - name: Upload coverage data
  81. uses: codecov/codecov-action@v2
  82. with:
  83. fail_ci_if_error: true
  84. files: /home/runner/frappe-bench/sites/coverage.xml
  85. verbose: true