Skip to content

Commit

Permalink
ci: make it preemtible with pending upstream PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Oct 1, 2024
1 parent c324937 commit fc110e5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
14 changes: 9 additions & 5 deletions .github/helper/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ 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}

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
Expand Down Expand Up @@ -40,9 +44,9 @@ 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 --branch ${BRANCH_TO_CLONE%"-hotfix"}
bench get-app https://github.com/frappe/erpnext --branch "$BRANCH_TO_CLONE" --resolve-deps
bench get-app https://github.com/frappe/lending --branch ${BRANCH_TO_CLONE%"-hotfix"}
bench get-app payments --branch ${githubbranch%"-hotfix"}
bench get-app https://github.com/frappe/erpnext --branch "$githubbranch" --resolve-deps
bench get-app https://github.com/frappe/lending --branch ${githubbranch%"-hotfix"}
bench get-app hrms "${GITHUB_WORKSPACE}"
bench setup requirements --dev

Expand All @@ -51,4 +55,4 @@ CI=Yes bench build --app frappe &
bench --site test_site reinstall --yes

bench --verbose --site test_site install-app lending
bench --verbose --site test_site install-app hrms
bench --verbose --site test_site install-app hrms
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ jobs:
run: |
bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
env:
BRANCH_TO_CLONE: ${{ env.HR_BRANCH }}
FRAPPE_USER: ${{ github.event.inputs.user }}
FRAPPE_BRANCH: ${{ github.event.inputs.branch }}

- name: Run Tests
run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app hrms --total-builds 2 --build-number ${{ matrix.container }}
Expand Down Expand Up @@ -138,4 +139,4 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
verbose: true

0 comments on commit fc110e5

Please sign in to comment.