2022-01-02 18:03:10 +00:00
|
|
|
name: Server (Mariadb)
|
2021-03-12 08:39:52 +00:00
|
|
|
|
2021-05-28 08:09:53 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
2021-08-13 07:29:27 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '**.js'
|
2022-03-14 12:49:52 +00:00
|
|
|
- '**.css'
|
2021-08-13 07:29:27 +00:00
|
|
|
- '**.md'
|
2022-01-02 18:03:10 +00:00
|
|
|
- '**.html'
|
2021-05-28 08:09:53 +00:00
|
|
|
push:
|
|
|
|
branches: [ develop ]
|
2021-08-13 07:29:27 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '**.js'
|
|
|
|
- '**.md'
|
2022-02-03 12:00:42 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
user:
|
2023-01-09 12:46:04 +00:00
|
|
|
description: 'Frappe Framework repository user (add your username for forks)'
|
2022-02-03 12:00:42 +00:00
|
|
|
required: true
|
|
|
|
default: 'frappe'
|
|
|
|
type: string
|
|
|
|
branch:
|
2023-01-09 12:46:04 +00:00
|
|
|
description: 'Frappe Framework branch'
|
2022-02-03 12:00:42 +00:00
|
|
|
default: 'develop'
|
|
|
|
required: false
|
|
|
|
type: string
|
2021-03-12 08:39:52 +00:00
|
|
|
|
2021-08-30 08:37:13 +00:00
|
|
|
concurrency:
|
2022-08-09 11:49:48 +00:00
|
|
|
group: server-mariadb-develop-${{ github.event_name }}-${{ github.event.number || github.event_name == 'workflow_dispatch' && github.run_id || '' }}
|
2021-08-30 08:37:13 +00:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-03-12 08:39:52 +00:00
|
|
|
jobs:
|
|
|
|
test:
|
2021-08-30 12:54:48 +00:00
|
|
|
runs-on: ubuntu-latest
|
2021-07-29 11:45:12 +00:00
|
|
|
timeout-minutes: 60
|
2021-03-12 08:39:52 +00:00
|
|
|
|
|
|
|
strategy:
|
2021-05-08 08:21:34 +00:00
|
|
|
fail-fast: false
|
2021-03-15 05:47:19 +00:00
|
|
|
|
2021-03-12 08:39:52 +00:00
|
|
|
matrix:
|
2022-06-30 06:05:45 +00:00
|
|
|
container: [1, 2, 3, 4]
|
2021-05-07 18:34:34 +00:00
|
|
|
|
2021-05-12 12:44:22 +00:00
|
|
|
name: Python Unit Tests
|
2021-03-12 08:39:52 +00:00
|
|
|
|
|
|
|
services:
|
|
|
|
mysql:
|
2022-12-06 07:28:07 +00:00
|
|
|
image: mariadb:10.6
|
2021-03-12 08:39:52 +00:00
|
|
|
env:
|
2022-12-06 07:28:07 +00:00
|
|
|
MARIADB_ROOT_PASSWORD: 'root'
|
2021-03-12 08:39:52 +00:00
|
|
|
ports:
|
|
|
|
- 3306:3306
|
|
|
|
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Clone
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
2022-11-10 08:52:05 +00:00
|
|
|
python-version: '3.11'
|
2021-03-12 08:39:52 +00:00
|
|
|
|
2022-07-04 05:41:14 +00:00
|
|
|
- name: Check for valid Python & Merge Conflicts
|
|
|
|
run: |
|
|
|
|
python -m compileall -f "${GITHUB_WORKSPACE}"
|
|
|
|
if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
|
|
|
|
then echo "Found merge conflicts"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-08-30 06:37:11 +00:00
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
2023-06-26 07:32:08 +00:00
|
|
|
node-version: 18
|
2021-08-30 06:37:11 +00:00
|
|
|
check-latest: true
|
|
|
|
|
2021-03-12 08:39:52 +00:00
|
|
|
- name: Add to Hosts
|
|
|
|
run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
|
|
|
|
|
|
|
|
- name: Cache pip
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
2022-06-29 06:53:17 +00:00
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
|
2021-03-12 08:39:52 +00:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
${{ runner.os }}-
|
2021-05-07 18:34:34 +00:00
|
|
|
|
2021-03-12 08:39:52 +00:00
|
|
|
- name: Cache node modules
|
|
|
|
uses: actions/cache@v2
|
|
|
|
env:
|
|
|
|
cache-name: cache-node-modules
|
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
|
|
${{ runner.os }}-build-
|
|
|
|
${{ runner.os }}-
|
2021-05-07 18:34:34 +00:00
|
|
|
|
2021-03-12 08:39:52 +00:00
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
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
|
|
|
|
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
|
2021-10-20 09:13:39 +00:00
|
|
|
env:
|
2022-01-02 18:03:10 +00:00
|
|
|
DB: mariadb
|
2021-10-20 09:13:39 +00:00
|
|
|
TYPE: server
|
2022-02-03 12:00:42 +00:00
|
|
|
FRAPPE_USER: ${{ github.event.inputs.user }}
|
|
|
|
FRAPPE_BRANCH: ${{ github.event.inputs.branch }}
|
2021-03-12 08:39:52 +00:00
|
|
|
|
|
|
|
- name: Run Tests
|
2022-10-12 05:27:58 +00:00
|
|
|
run: 'cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --with-coverage --total-builds 4 --build-number ${{ matrix.container }}'
|
2021-03-12 08:39:52 +00:00
|
|
|
env:
|
2021-05-07 18:34:34 +00:00
|
|
|
TYPE: server
|
2021-05-09 05:59:00 +00:00
|
|
|
CI_BUILD_ID: ${{ github.run_id }}
|
2021-05-10 18:18:37 +00:00
|
|
|
ORCHESTRATOR_URL: http://test-orchestrator.frappe.io
|
2021-03-12 08:39:52 +00:00
|
|
|
|
2022-04-10 09:36:38 +00:00
|
|
|
- name: Upload coverage data
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: coverage-${{ matrix.container }}
|
|
|
|
path: /home/runner/frappe-bench/sites/coverage.xml
|
|
|
|
|
|
|
|
coverage:
|
|
|
|
name: Coverage Wrap Up
|
|
|
|
needs: test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-04-13 12:53:22 +00:00
|
|
|
- name: Clone
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2022-04-10 09:36:38 +00:00
|
|
|
- name: Download artifacts
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
|
2021-09-10 02:38:00 +00:00
|
|
|
- name: Upload coverage data
|
|
|
|
uses: codecov/codecov-action@v2
|
|
|
|
with:
|
|
|
|
name: MariaDB
|
|
|
|
fail_ci_if_error: true
|
|
|
|
verbose: true
|