test(patch): run patch tests for major releases

Run patch tests one at a time
v10 db -> v12-> v13 -> .... -> frappe:corresponding base branch and PR.
diff --git a/.github/workflows/patch.yml b/.github/workflows/patch.yml
index 92a1962..f8abb6c 100644
--- a/.github/workflows/patch.yml
+++ b/.github/workflows/patch.yml
@@ -86,4 +86,27 @@
           cd ~/frappe-bench/
           wget https://erpnext.com/files/v10-erpnext.sql.gz
           bench --site test_site --force restore ~/frappe-bench/v10-erpnext.sql.gz
+
+          git -C "apps/frappe" remote set-url upstream https://github.com/frappe/frappe.git
+          git -C "apps/erpnext" remote set-url upstream https://github.com/frappe/erpnext.git
+
+          for version in $(seq 12 13)
+          do
+              echo "Updating to v$version"
+              branch_name="version-$version"
+
+              git -C "apps/frappe" fetch --depth 1 upstream $branch_name:$branch_name
+              git -C "apps/erpnext" fetch --depth 1 upstream $branch_name:$branch_name
+
+              git -C "apps/frappe" checkout -q -f $branch_name
+              git -C "apps/erpnext" checkout -q -f $branch_name
+
+              bench setup requirements --python
+              bench --site test_site migrate
+          done
+
+
+          echo "Updating to latest version"
+          git -C "apps/frappe" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}"
+          git -C "apps/erpnext" checkout -q -f "$GITHUB_SHA"
           bench --site test_site migrate