No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

92 líneas
2.6 KiB

  1. name: Server
  2. on:
  3. push:
  4. branches:
  5. - develop
  6. pull_request:
  7. concurrency:
  8. group: develop-payments-${{ github.event.number }}
  9. cancel-in-progress: true
  10. jobs:
  11. tests:
  12. runs-on: ubuntu-latest
  13. strategy:
  14. fail-fast: false
  15. name: Server
  16. services:
  17. mariadb:
  18. image: mariadb:10.6
  19. env:
  20. MYSQL_ROOT_PASSWORD: root
  21. ports:
  22. - 3306:3306
  23. options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
  24. steps:
  25. - name: Clone
  26. uses: actions/checkout@v2
  27. - name: Setup Python
  28. uses: actions/setup-python@v2
  29. with:
  30. python-version: '3.10'
  31. - name: Setup Node
  32. uses: actions/setup-node@v2
  33. with:
  34. node-version: 14
  35. check-latest: true
  36. - name: Cache pip
  37. uses: actions/cache@v2
  38. with:
  39. path: ~/.cache/pip
  40. key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py', '**/setup.cfg') }}
  41. restore-keys: |
  42. ${{ runner.os }}-pip-
  43. ${{ runner.os }}-
  44. - name: Get yarn cache directory path
  45. id: yarn-cache-dir-path
  46. run: 'echo "::set-output name=dir::$(yarn cache dir)"'
  47. - uses: actions/cache@v2
  48. id: yarn-cache
  49. with:
  50. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  51. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  52. restore-keys: |
  53. ${{ runner.os }}-yarn-
  54. - name: Setup
  55. run: |
  56. pip install frappe-bench
  57. bench init --skip-redis-config-generation --skip-assets --frappe-branch ${GITHUB_BASE_REF:-${GITHUB_REF##*/}} --python "$(which python)" ~/frappe-bench
  58. mysql --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'"
  59. mysql --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
  60. - name: Install
  61. working-directory: /home/runner/frappe-bench
  62. run: |
  63. bench get-app payments $GITHUB_WORKSPACE
  64. bench setup requirements --dev
  65. bench new-site --db-root-password root --admin-password admin test_site
  66. bench start &> bench_start.log &
  67. bench --site test_site install-app payments
  68. bench build
  69. env:
  70. CI: 'Yes'
  71. - name: Run Tests
  72. working-directory: /home/runner/frappe-bench
  73. run: |
  74. bench --site test_site set-config allow_tests true
  75. bench --site test_site run-tests --app payments
  76. env:
  77. TYPE: server