ci: added collation server for mariadb

This commit is contained in:
Jannat Patel
2023-10-13 14:50:50 +05:30
parent 4c83264c4a
commit c20fa7e093

View File

@@ -31,65 +31,71 @@ jobs:
steps: steps:
- name: Clone - name: Clone
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v2 uses: actions/setup-python@v4
with: with:
python-version: "3.10" python-version: "3.11"
- name: Check for valid Python & Merge Conflicts
run: |
python -m compileall -q -f "${GITHUB_WORKSPACE}"
if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
then echo "Found merge conflicts"
exit 1
fi
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v2 uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 18
check-latest: true check-latest: true
- name: Setup ache for bench - name: Add to Hosts
uses: actions/cache@v2 run: |
echo "127.0.0.1 lms.test" | sudo tee -a /etc/hosts
- name: Cache pip
uses: actions/cache@v3
with: with:
path: ~/bench-cache path: ~/.cache/pip
key: ${{ runner.os }} key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Bench - name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: | run: |
pip3 install frappe-bench bash ${GITHUB_WORKSPACE}/.github/helper/install_dependencies.sh
which bench bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
env:
- name: Bench Init BEFORE: ${{ env.GITHUB_EVENT_PATH.before }}
run: | AFTER: ${{ env.GITHUB_EVENT_PATH.after }}
if [ -d ~/bench-cache/bench.tgz ] TYPE: server
then DB: ${{ matrix.db }}
(cd && tar xzf ~/bench-cache/bench.tgz)
else
bench init ~/frappe-bench --skip-redis-config-generation --skip-assets --python "$(which python)"
mkdir -p ~/bench-cache
(cd && tar czf ~/bench-cache/bench.tgz frappe-bench)
fi
- name: Add LMS app to bench
working-directory: /home/runner/frappe-bench
run: bench get-app lms $GITHUB_WORKSPACE
- name: Create bench site
working-directory: /home/runner/frappe-bench
run: bench new-site --mariadb-root-password root --admin-password admin frappe.local
- name: Install LMS app
working-directory: /home/runner/frappe-bench
run: bench --site frappe.local install-app lms
- name: Setup Requirements
working-directory: /home/runner/frappe-bench
run: bench setup requirements --dev
- name: Allow Tests
working-directory: /home/runner/frappe-bench
run: bench --site frappe.local set-config allow_tests true
- name: Build
working-directory: /home/runner/frappe-bench
run: bench --site frappe.local build
- name: Run Tests - name: Run Tests
working-directory: /home/runner/frappe-bench run: cd ~/frappe-bench/ && bench --site lms.test run-parallel-tests --app lms --total-builds 4 --build-number ${{ matrix.container }}
run: bench --site frappe.local run-tests --app lms env:
SITE: lms.test
CI_BUILD_ID: ${{ github.run_id }}
BUILD_NUMBER: ${{ matrix.container }}
TOTAL_BUILDS: 2
- name: Show bench output
if: ${{ always() }}
run: cat ~/frappe-bench/bench_start.log || true