blob: 77c0aee195b08e17731b484b811d385b1633bf4f [file] [log] [blame]
Suraj Shetty490aed22021-05-08 00:04:34 +05301name: Server
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +05302
Suraj Shetty97687832021-05-28 13:39:53 +05303on:
4 pull_request:
Ankush Menat8a6b82b2021-08-13 12:59:27 +05305 paths-ignore:
6 - '**.js'
7 - '**.md'
Suraj Shetty97687832021-05-28 13:39:53 +05308 workflow_dispatch:
9 push:
10 branches: [ develop ]
Ankush Menat8a6b82b2021-08-13 12:59:27 +053011 paths-ignore:
12 - '**.js'
13 - '**.md'
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053014
Ankush Menat9de0f752021-08-30 14:07:13 +053015concurrency:
16 group: server-develop-${{ github.event.number }}
17 cancel-in-progress: true
18
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053019jobs:
20 test:
Ankush Menat602374a2021-08-30 18:24:48 +053021 runs-on: ubuntu-latest
Ankush0bb60b32021-07-29 17:15:12 +053022 timeout-minutes: 60
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053023
24 strategy:
Suraj Shetty622bf072021-05-08 13:51:34 +053025 fail-fast: false
Mohammad Hasnain Mohsin Rajan46d54312021-03-15 11:17:19 +053026
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053027 matrix:
Suraj Shetty042118a2021-05-11 10:09:06 +053028 container: [1, 2, 3]
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053029
Suraj Shetty1f025a82021-05-12 18:14:22 +053030 name: Python Unit Tests
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053031
32 services:
33 mysql:
34 image: mariadb:10.3
35 env:
36 MYSQL_ALLOW_EMPTY_PASSWORD: YES
37 ports:
38 - 3306:3306
39 options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
40
41 steps:
42 - name: Clone
43 uses: actions/checkout@v2
44
45 - name: Setup Python
46 uses: actions/setup-python@v2
47 with:
Suraj Shetty28fdb2e2021-05-12 23:13:11 +053048 python-version: 3.7
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053049
Ankush Menate5e00702021-08-30 12:07:11 +053050 - name: Setup Node
51 uses: actions/setup-node@v2
52 with:
53 node-version: 14
54 check-latest: true
55
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053056 - name: Add to Hosts
57 run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
58
59 - name: Cache pip
60 uses: actions/cache@v2
61 with:
62 path: ~/.cache/pip
63 key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
64 restore-keys: |
65 ${{ runner.os }}-pip-
66 ${{ runner.os }}-
Suraj Shetty490aed22021-05-08 00:04:34 +053067
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053068 - name: Cache node modules
69 uses: actions/cache@v2
70 env:
71 cache-name: cache-node-modules
72 with:
73 path: ~/.npm
74 key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
75 restore-keys: |
76 ${{ runner.os }}-build-${{ env.cache-name }}-
77 ${{ runner.os }}-build-
78 ${{ runner.os }}-
Suraj Shetty490aed22021-05-08 00:04:34 +053079
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053080 - name: Get yarn cache directory path
81 id: yarn-cache-dir-path
82 run: echo "::set-output name=dir::$(yarn cache dir)"
83
84 - uses: actions/cache@v2
85 id: yarn-cache
86 with:
87 path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
88 key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
89 restore-keys: |
90 ${{ runner.os }}-yarn-
91
92 - name: Install
93 run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
Ankush Menat92c0dcc2021-10-20 14:43:39 +053094 env:
95 TYPE: server
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053096
97 - name: Run Tests
Suraj Shetty7044bcf2021-05-09 11:29:00 +053098 run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --use-orchestrator --with-coverage
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053099 env:
Suraj Shetty490aed22021-05-08 00:04:34 +0530100 TYPE: server
Suraj Shetty7044bcf2021-05-09 11:29:00 +0530101 CI_BUILD_ID: ${{ github.run_id }}
Suraj Shetty64083672021-05-10 23:48:37 +0530102 ORCHESTRATOR_URL: http://test-orchestrator.frappe.io
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +0530103
Suraj Shetty1fc8fcc2021-09-10 08:08:00 +0530104 - name: Upload coverage data
105 uses: codecov/codecov-action@v2
106 with:
107 name: MariaDB
108 fail_ci_if_error: true
109 files: /home/runner/frappe-bench/sites/coverage.xml
110 verbose: true