Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

116 строки
2.8 KiB

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