blob: 40f93651f4a84e42f7cb57684bbdc52eb432d354 [file] [log] [blame]
Conord2074b12022-01-02 12:03:10 -06001name: Server (Mariadb)
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'
Conord2074b12022-01-02 12:03:10 -06008 - '**.html'
Suraj Shetty97687832021-05-28 13:39:53 +05309 push:
10 branches: [ develop ]
Ankush Menat8a6b82b2021-08-13 12:59:27 +053011 paths-ignore:
12 - '**.js'
13 - '**.md'
Ankush Menat6f2c9c62022-02-03 17:30:42 +053014 workflow_dispatch:
15 inputs:
16 user:
17 description: 'user'
18 required: true
19 default: 'frappe'
20 type: string
21 branch:
22 description: 'Branch name'
23 default: 'develop'
24 required: false
25 type: string
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053026
Ankush Menat9de0f752021-08-30 14:07:13 +053027concurrency:
Conord2074b12022-01-02 12:03:10 -060028 group: server-mariadb-develop-${{ github.event.number }}
Ankush Menat9de0f752021-08-30 14:07:13 +053029 cancel-in-progress: true
30
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053031jobs:
32 test:
Ankush Menat602374a2021-08-30 18:24:48 +053033 runs-on: ubuntu-latest
Ankush0bb60b32021-07-29 17:15:12 +053034 timeout-minutes: 60
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053035
36 strategy:
Suraj Shetty622bf072021-05-08 13:51:34 +053037 fail-fast: false
Mohammad Hasnain Mohsin Rajan46d54312021-03-15 11:17:19 +053038
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053039 matrix:
Suraj Shetty042118a2021-05-11 10:09:06 +053040 container: [1, 2, 3]
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053041
Suraj Shetty1f025a82021-05-12 18:14:22 +053042 name: Python Unit Tests
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053043
44 services:
45 mysql:
46 image: mariadb:10.3
47 env:
48 MYSQL_ALLOW_EMPTY_PASSWORD: YES
49 ports:
50 - 3306:3306
51 options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
52
53 steps:
54 - name: Clone
55 uses: actions/checkout@v2
56
57 - name: Setup Python
58 uses: actions/setup-python@v2
59 with:
Ankush Menat2854f632022-01-10 13:51:06 +053060 python-version: 3.8
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053061
Ankush Menate5e00702021-08-30 12:07:11 +053062 - name: Setup Node
63 uses: actions/setup-node@v2
64 with:
65 node-version: 14
66 check-latest: true
67
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053068 - name: Add to Hosts
69 run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
70
71 - name: Cache pip
72 uses: actions/cache@v2
73 with:
74 path: ~/.cache/pip
75 key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
76 restore-keys: |
77 ${{ runner.os }}-pip-
78 ${{ runner.os }}-
Suraj Shetty490aed22021-05-08 00:04:34 +053079
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053080 - name: Cache node modules
81 uses: actions/cache@v2
82 env:
83 cache-name: cache-node-modules
84 with:
85 path: ~/.npm
86 key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
87 restore-keys: |
88 ${{ runner.os }}-build-${{ env.cache-name }}-
89 ${{ runner.os }}-build-
90 ${{ runner.os }}-
Suraj Shetty490aed22021-05-08 00:04:34 +053091
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053092 - name: Get yarn cache directory path
93 id: yarn-cache-dir-path
94 run: echo "::set-output name=dir::$(yarn cache dir)"
95
96 - uses: actions/cache@v2
97 id: yarn-cache
98 with:
99 path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
100 key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
101 restore-keys: |
102 ${{ runner.os }}-yarn-
103
104 - name: Install
105 run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
Ankush Menat92c0dcc2021-10-20 14:43:39 +0530106 env:
Conord2074b12022-01-02 12:03:10 -0600107 DB: mariadb
Ankush Menat92c0dcc2021-10-20 14:43:39 +0530108 TYPE: server
Ankush Menat6f2c9c62022-02-03 17:30:42 +0530109 FRAPPE_USER: ${{ github.event.inputs.user }}
110 FRAPPE_BRANCH: ${{ github.event.inputs.branch }}
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +0530111
112 - name: Run Tests
Suraj Shetty7044bcf2021-05-09 11:29:00 +0530113 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 +0530114 env:
Suraj Shetty490aed22021-05-08 00:04:34 +0530115 TYPE: server
Suraj Shetty7044bcf2021-05-09 11:29:00 +0530116 CI_BUILD_ID: ${{ github.run_id }}
Suraj Shetty64083672021-05-10 23:48:37 +0530117 ORCHESTRATOR_URL: http://test-orchestrator.frappe.io
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +0530118
Suraj Shetty1fc8fcc2021-09-10 08:08:00 +0530119 - name: Upload coverage data
120 uses: codecov/codecov-action@v2
121 with:
122 name: MariaDB
123 fail_ci_if_error: true
124 files: /home/runner/frappe-bench/sites/coverage.xml
125 verbose: true