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

101 рядки
2.6 KiB

  1. name: Server
  2. on:
  3. pull_request:
  4. workflow_dispatch:
  5. jobs:
  6. test:
  7. runs-on: ubuntu-18.04
  8. strategy:
  9. fail-fast: false
  10. matrix:
  11. container: [1, 2]
  12. name: Python Unit Tests (Postgres)
  13. services:
  14. postgres:
  15. image: postgres:12.4
  16. env:
  17. POSTGRES_PASSWORD: travis
  18. options: >-
  19. --health-cmd pg_isready
  20. --health-interval 10s
  21. --health-timeout 5s
  22. --health-retries 5
  23. ports:
  24. - 5432:5432
  25. steps:
  26. - name: Clone
  27. uses: actions/checkout@v2
  28. - name: Setup Python
  29. uses: actions/setup-python@v2
  30. with:
  31. python-version: 3.7
  32. - uses: actions/setup-node@v2
  33. with:
  34. node-version: '14'
  35. check-latest: true
  36. - name: Add to Hosts
  37. run: |
  38. echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
  39. echo "127.0.0.1 test_site_producer" | sudo tee -a /etc/hosts
  40. - name: Cache pip
  41. uses: actions/cache@v2
  42. with:
  43. path: ~/.cache/pip
  44. key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
  45. restore-keys: |
  46. ${{ runner.os }}-pip-
  47. ${{ runner.os }}-
  48. - name: Cache node modules
  49. uses: actions/cache@v2
  50. env:
  51. cache-name: cache-node-modules
  52. with:
  53. path: ~/.npm
  54. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
  55. restore-keys: |
  56. ${{ runner.os }}-build-${{ env.cache-name }}-
  57. ${{ runner.os }}-build-
  58. ${{ runner.os }}-
  59. - name: Get yarn cache directory path
  60. id: yarn-cache-dir-path
  61. run: echo "::set-output name=dir::$(yarn cache dir)"
  62. - uses: actions/cache@v2
  63. id: yarn-cache
  64. with:
  65. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  66. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  67. restore-keys: |
  68. ${{ runner.os }}-yarn-
  69. - name: Install Dependencies
  70. run: bash ${GITHUB_WORKSPACE}/.github/helper/install_dependencies.sh
  71. env:
  72. BEFORE: ${{ env.GITHUB_EVENT_PATH.before }}
  73. AFTER: ${{ env.GITHUB_EVENT_PATH.after }}
  74. TYPE: server
  75. - name: Install
  76. run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
  77. env:
  78. DB: postgres
  79. TYPE: server
  80. - name: Run Tests
  81. run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --use-orchestrator
  82. env:
  83. CI_BUILD_ID: ${{ github.run_id }}
  84. ORCHESTRATOR_URL: http://test-orchestrator.frappe.io