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.
 
 
 
 

113 line
3.0 KiB

  1. name: Server (Postgres)
  2. on:
  3. pull_request:
  4. paths-ignore:
  5. - '**.js'
  6. - '**.md'
  7. - '**.html'
  8. types: [opened, labelled, synchronize, reopened]
  9. concurrency:
  10. group: server-postgres-develop-${{ github.event.number }}
  11. cancel-in-progress: true
  12. jobs:
  13. test:
  14. if: ${{ contains(github.event.pull_request.labels.*.name, 'postgres') }}
  15. runs-on: ubuntu-latest
  16. timeout-minutes: 60
  17. strategy:
  18. fail-fast: false
  19. matrix:
  20. container: [1]
  21. name: Python Unit Tests
  22. services:
  23. postgres:
  24. image: postgres:13.3
  25. env:
  26. POSTGRES_PASSWORD: travis
  27. options: >-
  28. --health-cmd pg_isready
  29. --health-interval 10s
  30. --health-timeout 5s
  31. --health-retries 5
  32. ports:
  33. - 5432:5432
  34. steps:
  35. - name: Clone
  36. uses: actions/checkout@v2
  37. - name: Setup Python
  38. uses: actions/setup-python@v2
  39. with:
  40. python-version: '3.10'
  41. - name: Check for valid Python & Merge Conflicts
  42. run: |
  43. python -m compileall -f "${GITHUB_WORKSPACE}"
  44. if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
  45. then echo "Found merge conflicts"
  46. exit 1
  47. fi
  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', '**/pyproject.toml') }}
  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: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
  86. env:
  87. DB: postgres
  88. TYPE: server
  89. - name: Run Tests
  90. run: cd ~/xhiveframework-bench/ && bench --site test_site run-parallel-tests --app erpnext --use-orchestrator
  91. env:
  92. TYPE: server
  93. CI_BUILD_ID: ${{ github.run_id }}
  94. ORCHESTRATOR_URL: http://test-orchestrator.xhiveframework.io