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.
 
 
 
 

127 line
3.3 KiB

  1. name: Server (Mariadb)
  2. on:
  3. pull_request:
  4. paths-ignore:
  5. - '**.js'
  6. - '**.css'
  7. - '**.md'
  8. - '**.html'
  9. - '**.csv'
  10. push:
  11. branches: [ develop ]
  12. paths-ignore:
  13. - '**.js'
  14. - '**.md'
  15. workflow_dispatch:
  16. inputs:
  17. user:
  18. description: 'user'
  19. required: true
  20. default: 'xhiveframework'
  21. type: string
  22. branch:
  23. description: 'Branch name'
  24. default: 'develop'
  25. required: false
  26. type: string
  27. concurrency:
  28. group: server-mariadb-develop-${{ github.event.number }}
  29. cancel-in-progress: true
  30. jobs:
  31. test:
  32. runs-on: ubuntu-latest
  33. timeout-minutes: 60
  34. strategy:
  35. fail-fast: false
  36. matrix:
  37. container: [1, 2, 3]
  38. name: Python Unit Tests
  39. services:
  40. mysql:
  41. image: mariadb:10.3
  42. env:
  43. MYSQL_ALLOW_EMPTY_PASSWORD: YES
  44. ports:
  45. - 3306:3306
  46. options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
  47. steps:
  48. - name: Clone
  49. uses: actions/checkout@v2
  50. - name: Setup Python
  51. uses: actions/setup-python@v2
  52. with:
  53. python-version: '3.10'
  54. - name: Check for valid Python & Merge Conflicts
  55. run: |
  56. python -m compileall -f "${GITHUB_WORKSPACE}"
  57. if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
  58. then echo "Found merge conflicts"
  59. exit 1
  60. fi
  61. - name: Setup Node
  62. uses: actions/setup-node@v2
  63. with:
  64. node-version: 14
  65. check-latest: true
  66. - name: Add to Hosts
  67. run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
  68. - name: Cache pip
  69. uses: actions/cache@v2
  70. with:
  71. path: ~/.cache/pip
  72. key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
  73. restore-keys: |
  74. ${{ runner.os }}-pip-
  75. ${{ runner.os }}-
  76. - name: Cache node modules
  77. uses: actions/cache@v2
  78. env:
  79. cache-name: cache-node-modules
  80. with:
  81. path: ~/.npm
  82. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
  83. restore-keys: |
  84. ${{ runner.os }}-build-${{ env.cache-name }}-
  85. ${{ runner.os }}-build-
  86. ${{ runner.os }}-
  87. - name: Get yarn cache directory path
  88. id: yarn-cache-dir-path
  89. run: echo "::set-output name=dir::$(yarn cache dir)"
  90. - uses: actions/cache@v2
  91. id: yarn-cache
  92. with:
  93. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  94. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  95. restore-keys: |
  96. ${{ runner.os }}-yarn-
  97. - name: Install
  98. run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
  99. env:
  100. DB: mariadb
  101. TYPE: server
  102. FRAPPE_USER: ${{ github.event.inputs.user }}
  103. FRAPPE_BRANCH: ${{ github.event.inputs.branch }}
  104. - name: Run Tests
  105. run: 'cd ~/xhiveframework-bench/ && bench --site test_site run-parallel-tests --app erpnext --total-builds 3 --build-number ${{ matrix.container }}'
  106. env:
  107. TYPE: server
  108. CI_BUILD_ID: ${{ github.run_id }}