You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

107 regels
2.6 KiB

  1. name: CI
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. branches:
  8. - develop
  9. jobs:
  10. linters:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Checkout Code Repository
  14. uses: actions/checkout@v3
  15. - name: Set up Python
  16. uses: actions/setup-python@v4
  17. with:
  18. python-version: '3.10'
  19. - name: Install and Run Pre-commit
  20. uses: pre-commit/action@v2.0.0
  21. tests:
  22. runs-on: ubuntu-18.04
  23. timeout-minutes: 20
  24. strategy:
  25. fail-fast: false
  26. name: Server
  27. services:
  28. mysql:
  29. image: mariadb:10.3
  30. env:
  31. MYSQL_ALLOW_EMPTY_PASSWORD: YES
  32. ports:
  33. - 3306:3306
  34. options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
  35. steps:
  36. - name: Checkout Code Repository
  37. uses: actions/checkout@v3
  38. - name: Set up Python
  39. uses: actions/setup-python@v4
  40. with:
  41. python-version: '3.10'
  42. - name: Setup Node
  43. uses: actions/setup-node@v2
  44. with:
  45. node-version: 14
  46. check-latest: true
  47. - name: Add to Hosts
  48. run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
  49. - name: Cache pip
  50. uses: actions/cache@v2
  51. with:
  52. path: ~/.cache/pip
  53. key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt') }}
  54. restore-keys: |
  55. ${{ runner.os }}-pip-
  56. ${{ runner.os }}-
  57. - name: Cache node modules
  58. uses: actions/cache@v2
  59. env:
  60. cache-name: cache-node-modules
  61. with:
  62. path: ~/.npm
  63. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
  64. restore-keys: |
  65. ${{ runner.os }}-build-${{ env.cache-name }}-
  66. ${{ runner.os }}-build-
  67. ${{ runner.os }}-
  68. - name: Get yarn cache directory path
  69. id: yarn-cache-dir-path
  70. run: echo "::set-output name=dir::$(yarn cache dir)"
  71. - uses: actions/cache@v2
  72. id: yarn-cache
  73. with:
  74. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  75. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  76. restore-keys: |
  77. ${{ runner.os }}-yarn-
  78. - name: Install
  79. run: |
  80. bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
  81. cd ~/frappe-bench/ && source env/bin/activate
  82. cd apps/healthcare && pip install -r dev-requirements.txt
  83. env:
  84. TYPE: server
  85. - name: Run Tests
  86. run: cd ~/frappe-bench/ && bench --site test_site run-tests --app healthcare
  87. env:
  88. TYPE: server