Skip to content

Commit

Permalink
ci: update
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Oct 25, 2024
1 parent bd7b494 commit bbcc00e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
13 changes: 9 additions & 4 deletions .github/helper/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
Expand All @@ -40,13 +45,13 @@ 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

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
bench --verbose --site test_site install-app webshop
13 changes: 6 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}-
Expand Down Expand Up @@ -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
path: /home/runner/frappe-bench/sites/coverage.xml

0 comments on commit bbcc00e

Please sign in to comment.