Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/helper/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ wkpid=$!

pip install frappe-bench

git clone "https://github.com/frappe/frappe" --branch "$BRANCH_TO_CLONE" --depth 1
FRAPPE_REMOTE=${FRAPPE_REMOTE:-https://github.com/frappe/frappe.git}
FRAPPE_BRANCH=${FRAPPE_BRANCH:-$BRANCH_TO_CLONE}

git clone "$FRAPPE_REMOTE" --branch "$FRAPPE_BRANCH" --depth 1
bench init --skip-assets --frappe-path ~/frappe --python "$(which python)" frappe-bench

mkdir ~/frappe-bench/sites/test_site
Expand All @@ -53,7 +56,15 @@ 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 erpnext --branch "$BRANCH_TO_CLONE" --resolve-deps

ERPNEXT_REMOTE=${ERPNEXT_REMOTE:-https://github.com/frappe/erpnext.git}
ERPNEXT_BRANCH=${ERPNEXT_BRANCH:-$BRANCH_TO_CLONE}

if [ "$ERPNEXT_REMOTE" != "https://github.com/frappe/erpnext.git" ]; then
bench get-app "$ERPNEXT_REMOTE" --branch "$ERPNEXT_BRANCH" --resolve-deps
else
bench get-app erpnext --branch "$ERPNEXT_BRANCH" --resolve-deps
fi
bench get-app india_compliance "${GITHUB_WORKSPACE}"
bench setup requirements --dev

Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/server-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,36 @@ on:
- "**.md"
- "**.html"
- "**.csv"
workflow_dispatch:
inputs:
frappe_remote:
description: "Frappe remote URL"
required: false
default: "https://github.com/frappe/frappe.git"
type: string
frappe_branch:
description: "Frappe branch"
required: false
default: "develop"
type: string
erpnext_remote:
description: "ERPNext remote URL"
required: false
default: "https://github.com/frappe/erpnext.git"
type: string
erpnext_branch:
description: "ERPNext branch"
required: false
default: "develop"
type: string
env:
BRANCH: ${{ inputs.base_ref || github.base_ref || github.ref_name }}
APP_NAME: ${{ inputs.app_name || 'india_compliance' }}

concurrency:
group: server-tests-${{ github.event_name }}-${{ github.event.number || github.event_name == 'workflow_dispatch' && github.run_id || '' }}
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -108,6 +134,10 @@ jobs:
bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
env:
BRANCH_TO_CLONE: ${{ env.BRANCH }}
FRAPPE_REMOTE: ${{ inputs.frappe_remote }}
FRAPPE_BRANCH: ${{ inputs.frappe_branch }}
ERPNEXT_REMOTE: ${{ inputs.erpnext_remote }}
ERPNEXT_BRANCH: ${{ inputs.erpnext_branch }}

- name: Run Tests
run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app ${{ env.APP_NAME }} --with-coverage
Expand Down
Loading