From c872d20549252d9d27e65b5c8f183bd0ca943d9f Mon Sep 17 00:00:00 2001 From: David Date: Wed, 2 Oct 2024 01:25:52 +0200 Subject: [PATCH 1/3] ci: make it preemtible with pending upstream PRs --- .github/helper/install.sh | 14 ++++++++++---- .github/workflows/ci.yml | 7 +++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/helper/install.sh b/.github/helper/install.sh index 4b8651f1..849aba47 100644 --- a/.github/helper/install.sh +++ b/.github/helper/install.sh @@ -10,7 +10,13 @@ sudo apt install libcups2-dev redis-server mariadb-client-10.6 pip install frappe-bench -git clone https://github.com/frappe/frappe --branch "$BRANCH_TO_CLONE" --depth 1 +githubbranch=${GITHUB_BASE_REF:-${GITHUB_REF##*/}} +frappeuser=${FRAPPE_USER:-"frappe"} +frappebranch=${FRAPPE_BRANCH:-$githubbranch} +erpnextbranch=${ERPNEXT_BRANCH:-"develop"} +paymentsbranch=${PAYMENTS_BRANCH:-${githubbranch%"-hotfix"}} + +git clone "https://github.com/${frappeuser}/frappe" --branch "${frappebranch}" --depth 1 bench init --skip-assets --frappe-path ~/frappe --python "$(which python)" frappe-bench mkdir ~/frappe-bench/sites/test_site @@ -40,8 +46,8 @@ sed -i 's/schedule:/# schedule:/g' Procfile sed -i 's/socketio:/# socketio:/g' Procfile sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile -bench get-app payments -bench get-app https://github.com/frappe/erpnext --branch develop --resolve-deps +bench get-app "https://github.com/${frappeuser}/payments" --branch "$paymentsbranch" +bench get-app "https://github.com/${frappeuser}/erpnext" --branch "$erpnextbranch" --resolve-deps bench setup requirements --dev bench start &> bench_run_logs.txt & @@ -50,4 +56,4 @@ bench --site test_site reinstall --yes bench get-app lending "${GITHUB_WORKSPACE}" bench --site test_site install-app lending -bench setup requirements --dev \ No newline at end of file +bench setup requirements --dev diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c564a87..9f8b1164 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,8 +21,6 @@ on: schedule: # Run everday at midnight UTC / 5:30 IST - cron: "0 0 * * *" -env: - LENDING_BRANCH: ${{ github.base_ref || github.ref_name }} concurrency: group: develop-${{ github.event.number }} @@ -101,7 +99,8 @@ jobs: run: | bash ${GITHUB_WORKSPACE}/.github/helper/install.sh env: - BRANCH_TO_CLONE: ${{ env.LENDING_BRANCH }} + FRAPPE_USER: ${{ github.event.inputs.user }} + FRAPPE_BRANCH: ${{ github.event.inputs.branch }} - name: Run Tests @@ -116,4 +115,4 @@ jobs: with: fail_ci_if_error: true files: /home/runner/frappe-bench/sites/coverage.xml - verbose: true \ No newline at end of file + verbose: true From 045e6b2b06cc0ca693df2c2abf5301e8ee357b8d Mon Sep 17 00:00:00 2001 From: David Date: Wed, 2 Oct 2024 01:28:52 +0200 Subject: [PATCH 2/3] ci: test against proper erpnext version --- .github/helper/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/helper/install.sh b/.github/helper/install.sh index 849aba47..28197d61 100644 --- a/.github/helper/install.sh +++ b/.github/helper/install.sh @@ -13,7 +13,7 @@ pip install frappe-bench githubbranch=${GITHUB_BASE_REF:-${GITHUB_REF##*/}} frappeuser=${FRAPPE_USER:-"frappe"} frappebranch=${FRAPPE_BRANCH:-$githubbranch} -erpnextbranch=${ERPNEXT_BRANCH:-"develop"} +erpnextbranch=${ERPNEXT_BRANCH:-$githubbranch} paymentsbranch=${PAYMENTS_BRANCH:-${githubbranch%"-hotfix"}} git clone "https://github.com/${frappeuser}/frappe" --branch "${frappebranch}" --depth 1 From 694a246820bce91c97de4e0d80fef8ad6e83702e Mon Sep 17 00:00:00 2001 From: David Date: Wed, 2 Oct 2024 01:31:35 +0200 Subject: [PATCH 3/3] ci: preempt read-only-mapper merge in frappe --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f8b1164..6290590b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,8 +99,8 @@ jobs: run: | bash ${GITHUB_WORKSPACE}/.github/helper/install.sh env: - FRAPPE_USER: ${{ github.event.inputs.user }} - FRAPPE_BRANCH: ${{ github.event.inputs.branch }} + FRAPPE_USER: blaggacao + FRAPPE_BRANCH: feat/add-read-only-document-context-to-mapper - name: Run Tests