ci: measure bench install times and control verbosity
This commit is contained in:
parent
f0ba65eb9b
commit
b77f112fb2
4 changed files with 39 additions and 33 deletions
27
.github/helper/install_bench.sh
vendored
27
.github/helper/install_bench.sh
vendored
|
|
@ -2,17 +2,34 @@
|
|||
set -e
|
||||
cd ~ || exit
|
||||
|
||||
verbosity="${BENCH_VERBOSITY_FLAG:-}"
|
||||
|
||||
start_time=$(date +%s)
|
||||
echo "::group::Install Bench"
|
||||
pip install frappe-bench
|
||||
echo "::endgroup::"
|
||||
end_time=$(date +%s)
|
||||
echo "Time taken to Install Bench: $((end_time - start_time)) seconds"
|
||||
|
||||
echo "::group::Init Bench"
|
||||
bench -v init frappe-bench --skip-assets --python "$(which python)" --frappe-path "${GITHUB_WORKSPACE}"
|
||||
cd ./frappe-bench || exit
|
||||
git config --global init.defaultBranch main
|
||||
git config --global advice.detachedHead false
|
||||
|
||||
bench -v setup requirements --dev
|
||||
start_time=$(date +%s)
|
||||
echo "::group::Init Bench & Install Frappe"
|
||||
bench $verbosity init frappe-bench --skip-assets --python "$(which python)" --frappe-path "${GITHUB_WORKSPACE}"
|
||||
echo "::endgroup::"
|
||||
end_time=$(date +%s)
|
||||
echo "Time taken to Init Bench & Install Frappe: $((end_time - start_time)) seconds"
|
||||
|
||||
cd ~/frappe-bench || exit
|
||||
|
||||
start_time=$(date +%s)
|
||||
echo "::group::Install App Requirements"
|
||||
bench $verbosity setup requirements --dev
|
||||
if [ "$TYPE" == "ui" ]
|
||||
then
|
||||
bench -v setup requirements --node;
|
||||
bench $verbosity setup requirements --node;
|
||||
fi
|
||||
end_time=$(date +%s)
|
||||
echo "::endgroup::"
|
||||
echo "Time taken to Install App Requirements: $((end_time - start_time)) seconds"
|
||||
8
.github/workflows/patch-mariadb-tests.yml
vendored
8
.github/workflows/patch-mariadb-tests.yml
vendored
|
|
@ -99,21 +99,13 @@ jobs:
|
|||
- name: Install Dependencies
|
||||
run: |
|
||||
bash ${GITHUB_WORKSPACE}/.github/helper/install_dependencies.sh
|
||||
env:
|
||||
BEFORE: ${{ env.GITHUB_EVENT_PATH.before }}
|
||||
AFTER: ${{ env.GITHUB_EVENT_PATH.after }}
|
||||
TYPE: server
|
||||
DB: mariadb
|
||||
|
||||
- name: Init Bench
|
||||
run: |
|
||||
pip install frappe-bench
|
||||
bash ${GITHUB_WORKSPACE}/.github/helper/install_bench.sh
|
||||
env:
|
||||
BEFORE: ${{ env.GITHUB_EVENT_PATH.before }}
|
||||
AFTER: ${{ env.GITHUB_EVENT_PATH.after }}
|
||||
TYPE: server
|
||||
DB: mariadb
|
||||
|
||||
- name: Init Test Site
|
||||
run: |
|
||||
|
|
|
|||
27
.github/workflows/server-tests.yml
vendored
27
.github/workflows/server-tests.yml
vendored
|
|
@ -36,6 +36,7 @@ jobs:
|
|||
PR_NUMBER: ${{ github.event.number }}
|
||||
REPO_NAME: ${{ github.repository }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
test:
|
||||
name: Unit Tests
|
||||
|
|
@ -80,6 +81,12 @@ jobs:
|
|||
- 3000:80
|
||||
|
||||
steps:
|
||||
- name: Has pyproject.toml changed?
|
||||
id: changed-pyproject
|
||||
uses: tj-actions/changed-files@v45
|
||||
with:
|
||||
files: pyproject.toml
|
||||
|
||||
- name: Clone
|
||||
uses: actions/checkout@v4
|
||||
|
||||
|
|
@ -96,6 +103,15 @@ jobs:
|
|||
exit 1
|
||||
fi
|
||||
|
||||
- name: Check if pyproject.toml changed
|
||||
id: check_changes
|
||||
run: |
|
||||
if git diff --name-only origin/${{ github.base_ref }}..HEAD | grep -q "pyproject.toml"; then
|
||||
echo "pyproject_changed=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "pyproject_changed=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
|
|
@ -129,22 +145,13 @@ jobs:
|
|||
- name: Install Dependencies
|
||||
run: |
|
||||
bash ${GITHUB_WORKSPACE}/.github/helper/install_dependencies.sh
|
||||
env:
|
||||
BEFORE: ${{ env.GITHUB_EVENT_PATH.before }}
|
||||
AFTER: ${{ env.GITHUB_EVENT_PATH.after }}
|
||||
FRAPPE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
TYPE: server
|
||||
DB: ${{ matrix.db }}
|
||||
|
||||
- name: Init Bench
|
||||
run: |
|
||||
bash ${GITHUB_WORKSPACE}/.github/helper/install_bench.sh
|
||||
env:
|
||||
BEFORE: ${{ env.GITHUB_EVENT_PATH.before }}
|
||||
AFTER: ${{ env.GITHUB_EVENT_PATH.after }}
|
||||
FRAPPE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
TYPE: server
|
||||
DB: ${{ matrix.db }}
|
||||
BENCH_VERBOSITY_FLAG: ${{ steps.changed-pyproject.outputs.any_modified == 'true' && '-v' || ''}}
|
||||
|
||||
- name: Init Test Site
|
||||
run: |
|
||||
|
|
|
|||
10
.github/workflows/ui-tests.yml
vendored
10
.github/workflows/ui-tests.yml
vendored
|
|
@ -118,22 +118,12 @@ jobs:
|
|||
- name: Install Dependencies
|
||||
run: |
|
||||
bash ${GITHUB_WORKSPACE}/.github/helper/install_dependencies.sh
|
||||
env:
|
||||
BEFORE: ${{ env.GITHUB_EVENT_PATH.before }}
|
||||
AFTER: ${{ env.GITHUB_EVENT_PATH.after }}
|
||||
FRAPPE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
TYPE: ui
|
||||
DB: mariadb
|
||||
|
||||
- name: Init Bench
|
||||
run: |
|
||||
bash ${GITHUB_WORKSPACE}/.github/helper/install_bench.sh
|
||||
env:
|
||||
BEFORE: ${{ env.GITHUB_EVENT_PATH.before }}
|
||||
AFTER: ${{ env.GITHUB_EVENT_PATH.after }}
|
||||
FRAPPE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
TYPE: ui
|
||||
DB: mariadb
|
||||
|
||||
- name: Init Test Site
|
||||
run: |
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue