blob: d05bbbec50a2e9c2ba0409bb660ca103d9e3f3e0 [file] [log] [blame]
Suraj Shetty490aed22021-05-08 00:04:34 +05301name: Patch
2
Ankush Menat8a6b82b2021-08-13 12:59:27 +05303on:
4 pull_request:
5 paths-ignore:
6 - '**.js'
7 - '**.md'
8 workflow_dispatch:
9
Ankush Menat9de0f752021-08-30 14:07:13 +053010concurrency:
11 group: patch-develop-${{ github.event.number }}
12 cancel-in-progress: true
Suraj Shetty490aed22021-05-08 00:04:34 +053013
14jobs:
15 test:
Ankush Menat602374a2021-08-30 18:24:48 +053016 runs-on: ubuntu-latest
Ankush0bb60b32021-07-29 17:15:12 +053017 timeout-minutes: 60
Suraj Shetty490aed22021-05-08 00:04:34 +053018
19 name: Patch Test
20
21 services:
22 mysql:
23 image: mariadb:10.3
24 env:
25 MYSQL_ALLOW_EMPTY_PASSWORD: YES
26 ports:
27 - 3306:3306
28 options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
29
30 steps:
31 - name: Clone
32 uses: actions/checkout@v2
33
34 - name: Setup Python
35 uses: actions/setup-python@v2
36 with:
Ankush Menat2854f632022-01-10 13:51:06 +053037 python-version: 3.8
Ankush Menate5e00702021-08-30 12:07:11 +053038
39 - name: Setup Node
40 uses: actions/setup-node@v2
41 with:
42 node-version: 14
43 check-latest: true
Suraj Shetty490aed22021-05-08 00:04:34 +053044
45 - name: Add to Hosts
46 run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
47
48 - name: Cache pip
49 uses: actions/cache@v2
50 with:
51 path: ~/.cache/pip
52 key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
53 restore-keys: |
54 ${{ runner.os }}-pip-
55 ${{ runner.os }}-
56
57 - name: Cache node modules
58 uses: actions/cache@v2
59 env:
60 cache-name: cache-node-modules
61 with:
62 path: ~/.npm
63 key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
64 restore-keys: |
65 ${{ runner.os }}-build-${{ env.cache-name }}-
66 ${{ runner.os }}-build-
67 ${{ runner.os }}-
68
69 - name: Get yarn cache directory path
70 id: yarn-cache-dir-path
71 run: echo "::set-output name=dir::$(yarn cache dir)"
72
73 - uses: actions/cache@v2
74 id: yarn-cache
75 with:
76 path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
77 key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
78 restore-keys: |
79 ${{ runner.os }}-yarn-
80
81 - name: Install
82 run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
Conord2074b12022-01-02 12:03:10 -060083 env:
84 DB: mariadb
85 TYPE: server
Suraj Shetty490aed22021-05-08 00:04:34 +053086
87 - name: Run Patch Tests
Gavin D'souzac68006b2021-06-03 20:05:00 +053088 run: |
89 cd ~/frappe-bench/
90 wget https://erpnext.com/files/v10-erpnext.sql.gz
91 bench --site test_site --force restore ~/frappe-bench/v10-erpnext.sql.gz
Ankush Menat27cbeb92021-09-26 14:10:52 +053092
93 git -C "apps/frappe" remote set-url upstream https://github.com/frappe/frappe.git
94 git -C "apps/erpnext" remote set-url upstream https://github.com/frappe/erpnext.git
95
96 for version in $(seq 12 13)
97 do
98 echo "Updating to v$version"
Ankush Menatb7285972021-11-10 17:59:07 +053099 branch_name="version-$version-hotfix"
Ankush Menat27cbeb92021-09-26 14:10:52 +0530100
101 git -C "apps/frappe" fetch --depth 1 upstream $branch_name:$branch_name
102 git -C "apps/erpnext" fetch --depth 1 upstream $branch_name:$branch_name
103
104 git -C "apps/frappe" checkout -q -f $branch_name
105 git -C "apps/erpnext" checkout -q -f $branch_name
106
107 bench setup requirements --python
108 bench --site test_site migrate
109 done
110
111
112 echo "Updating to latest version"
113 git -C "apps/frappe" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}"
114 git -C "apps/erpnext" checkout -q -f "$GITHUB_SHA"
Gavin D'souzac68006b2021-06-03 20:05:00 +0530115 bench --site test_site migrate