Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

143 lignes
4.3 KiB

  1. name: Patch
  2. on:
  3. pull_request:
  4. paths-ignore:
  5. - '**.js'
  6. - '**.css'
  7. - '**.md'
  8. - '**.html'
  9. - '**.csv'
  10. workflow_dispatch:
  11. concurrency:
  12. group: patch-develop-${{ github.event.number }}
  13. cancel-in-progress: true
  14. jobs:
  15. test:
  16. runs-on: ubuntu-latest
  17. timeout-minutes: 60
  18. name: Patch Test
  19. services:
  20. mysql:
  21. image: mariadb:10.3
  22. env:
  23. MYSQL_ALLOW_EMPTY_PASSWORD: YES
  24. ports:
  25. - 3306:3306
  26. options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
  27. steps:
  28. - name: Clone
  29. uses: actions/checkout@v2
  30. - name: Check for valid Python & Merge Conflicts
  31. run: |
  32. python -m compileall -f "${GITHUB_WORKSPACE}"
  33. if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
  34. then echo "Found merge conflicts"
  35. exit 1
  36. fi
  37. - name: Setup Python
  38. uses: "gabrielfalcao/pyenv-action@v9"
  39. with:
  40. versions: 3.10:latest, 3.7:latest
  41. - name: Setup Node
  42. uses: actions/setup-node@v2
  43. with:
  44. node-version: 14
  45. check-latest: true
  46. - name: Add to Hosts
  47. run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
  48. - name: Cache pip
  49. uses: actions/cache@v2
  50. with:
  51. path: ~/.cache/pip
  52. key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
  53. restore-keys: |
  54. ${{ runner.os }}-pip-
  55. ${{ runner.os }}-
  56. - name: Cache node modules
  57. uses: actions/cache@v2
  58. env:
  59. cache-name: cache-node-modules
  60. with:
  61. path: ~/.npm
  62. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
  63. restore-keys: |
  64. ${{ runner.os }}-build-${{ env.cache-name }}-
  65. ${{ runner.os }}-build-
  66. ${{ runner.os }}-
  67. - name: Get yarn cache directory path
  68. id: yarn-cache-dir-path
  69. run: echo "::set-output name=dir::$(yarn cache dir)"
  70. - uses: actions/cache@v2
  71. id: yarn-cache
  72. with:
  73. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  74. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  75. restore-keys: |
  76. ${{ runner.os }}-yarn-
  77. - name: Install
  78. run: |
  79. pip install xhiveframework-bench
  80. pyenv global $(pyenv versions | grep '3.10')
  81. bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
  82. env:
  83. DB: mariadb
  84. TYPE: server
  85. - name: Run Patch Tests
  86. run: |
  87. cd ~/xhiveframework-bench/
  88. wget https://erpnext.com/files/v10-erpnext.sql.gz
  89. bench --site test_site --force restore ~/xhiveframework-bench/v10-erpnext.sql.gz
  90. git -C "apps/xhiveframework" remote set-url upstream https://github.com/xhiveframework/xhiveframework.git
  91. git -C "apps/erpnext" remote set-url upstream https://github.com/xhiveframework/xhiveerp.git
  92. pyenv global $(pyenv versions | grep '3.7')
  93. for version in $(seq 12 13)
  94. do
  95. echo "Updating to v$version"
  96. branch_name="version-$version-hotfix"
  97. git -C "apps/xhiveframework" fetch --depth 1 upstream $branch_name:$branch_name
  98. git -C "apps/erpnext" fetch --depth 1 upstream $branch_name:$branch_name
  99. git -C "apps/xhiveframework" checkout -q -f $branch_name
  100. git -C "apps/erpnext" checkout -q -f $branch_name
  101. rm -rf ~/xhiveframework-bench/env
  102. bench setup env
  103. bench pip install -e ./apps/payments
  104. bench pip install -e ./apps/erpnext
  105. bench --site test_site migrate
  106. done
  107. echo "Updating to latest version"
  108. git -C "apps/xhiveframework" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}"
  109. git -C "apps/erpnext" checkout -q -f "$GITHUB_SHA"
  110. pyenv global $(pyenv versions | grep '3.10')
  111. rm -rf ~/xhiveframework-bench/env
  112. bench -v setup env
  113. bench pip install -e ./apps/payments
  114. bench pip install -e ./apps/erpnext
  115. bench --site test_site migrate
  116. bench --site test_site install-app payments