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.
 
 
 
 
 
 

135 líneas
4.0 KiB

  1. name: Patch
  2. on: [pull_request, workflow_dispatch]
  3. concurrency:
  4. group: patch-mariadb-develop-${{ github.event.number }}
  5. cancel-in-progress: true
  6. permissions:
  7. contents: read
  8. jobs:
  9. test:
  10. runs-on: ubuntu-latest
  11. timeout-minutes: 60
  12. name: Patch Test
  13. services:
  14. mysql:
  15. image: mariadb:10.3
  16. env:
  17. MYSQL_ALLOW_EMPTY_PASSWORD: YES
  18. ports:
  19. - 3306:3306
  20. options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
  21. steps:
  22. - name: Clone
  23. uses: actions/checkout@v2
  24. - name: Setup Python
  25. uses: actions/setup-python@v2
  26. with:
  27. python-version: '3.9'
  28. - name: Setup Node
  29. uses: actions/setup-node@v2
  30. with:
  31. node-version: 14
  32. check-latest: true
  33. - name: Check if build should be run
  34. id: check-build
  35. run: |
  36. python "${GITHUB_WORKSPACE}/.github/helper/roulette.py"
  37. env:
  38. TYPE: "server"
  39. PR_NUMBER: ${{ github.event.number }}
  40. REPO_NAME: ${{ github.repository }}
  41. - name: Add to Hosts
  42. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  43. run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
  44. - name: Cache pip
  45. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  46. uses: actions/cache@v2
  47. with:
  48. path: ~/.cache/pip
  49. key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
  50. restore-keys: |
  51. ${{ runner.os }}-pip-
  52. ${{ runner.os }}-
  53. - name: Cache node modules
  54. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  55. uses: actions/cache@v2
  56. env:
  57. cache-name: cache-node-modules
  58. with:
  59. path: ~/.npm
  60. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
  61. restore-keys: |
  62. ${{ runner.os }}-build-${{ env.cache-name }}-
  63. ${{ runner.os }}-build-
  64. ${{ runner.os }}-
  65. - name: Get yarn cache directory path
  66. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  67. id: yarn-cache-dir-path
  68. run: echo "::set-output name=dir::$(yarn cache dir)"
  69. - uses: actions/cache@v2
  70. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  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 Dependencies
  78. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  79. run: bash ${GITHUB_WORKSPACE}/.github/helper/install_dependencies.sh
  80. env:
  81. BEFORE: ${{ env.GITHUB_EVENT_PATH.before }}
  82. AFTER: ${{ env.GITHUB_EVENT_PATH.after }}
  83. TYPE: server
  84. - name: Install
  85. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  86. run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
  87. env:
  88. DB: mariadb
  89. TYPE: server
  90. - name: Run Patch Tests
  91. if: ${{ steps.check-build.outputs.build == 'strawberry' }}
  92. run: |
  93. cd ~/frappe-bench/
  94. wget https://frappeframework.com/files/v10-frappe.sql.gz
  95. bench --site test_site --force restore ~/frappe-bench/v10-frappe.sql.gz
  96. source env/bin/activate
  97. cd apps/frappe/
  98. git remote set-url upstream https://github.com/frappe/frappe.git
  99. for version in $(seq 12 13)
  100. do
  101. echo "Updating to v$version"
  102. branch_name="version-$version-hotfix"
  103. git fetch --depth 1 upstream $branch_name:$branch_name
  104. git checkout -q -f $branch_name
  105. pip install -q -r requirements.txt
  106. bench --site test_site migrate
  107. done
  108. echo "Updating to last commit"
  109. git checkout -q -f "$GITHUB_SHA"
  110. bench setup requirements --python
  111. bench --site test_site migrate