diff --git a/.github/helper/install.sh b/.github/helper/install.sh index e648669b02..5c4aa29165 100644 --- a/.github/helper/install.sh +++ b/.github/helper/install.sh @@ -10,10 +10,15 @@ 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 + cp -r "${GITHUB_WORKSPACE}/.github/helper/site_config_mariadb.json" ~/frappe-bench/sites/test_site/ mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'" @@ -40,8 +45,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 --branch ${BRANCH_TO_CLONE%"-hotfix"} -bench get-app https://github.com/frappe/erpnext --branch "$BRANCH_TO_CLONE" --resolve-deps +bench get-app erpnext --branch ${githubbranch%"-hotfix"} --resolve-deps +bench get-app payments --branch ${githubbranch%"-hotfix"} bench get-app webshop "${GITHUB_WORKSPACE}" bench setup requirements --dev @@ -49,4 +54,4 @@ bench start &>> ~/frappe-bench/bench_start.log & CI=Yes bench build --app frappe & bench --site test_site reinstall --yes -bench --verbose --site test_site install-app webshop \ No newline at end of file +bench --verbose --site test_site install-app webshop diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18bbe9ed4c..f10a9fd176 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,7 @@ jobs: uses: actions/cache@v2 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt') }} + key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py') }} restore-keys: | ${{ runner.os }}-pip- ${{ runner.os }}- @@ -91,18 +91,17 @@ jobs: run: | bash ${GITHUB_WORKSPACE}/.github/helper/install.sh env: - BRANCH_TO_CLONE: ${{ env.WEBSHOP_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-tests --app webshop --coverage + run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app webshop --total-builds 1 --build-number 1 env: TYPE: server - CI_BUILD_ID: ${{ github.run_id }} - ORCHESTRATOR_URL: http://test-orchestrator.frappe.io + CAPTURE_COVERAGE: ${{ github.event_name != 'pull_request' }} - name: Upload coverage data uses: actions/upload-artifact@v3 with: name: coverage-${{ matrix.container }} - path: /home/runner/frappe-bench/sites/coverage.xml \ No newline at end of file + path: /home/runner/frappe-bench/sites/coverage.xml