blob: 69be7656a6ce5a2684cabfc136d9d21d3e855c34 [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'
Ankush Menatf1a7e3b2022-03-14 18:19:52 +05307 - '**.css'
Ankush Menat8a6b82b2021-08-13 12:59:27 +05308 - '**.md'
Conord2074b12022-01-02 12:03:10 -06009 - '**.html'
Ankush Menatf1a7e3b2022-03-14 18:19:52 +053010 - '**.csv'
Suraj Shetty97687832021-05-28 13:39:53 +053011 push:
12 branches: [ develop ]
Ankush Menat8a6b82b2021-08-13 12:59:27 +053013 paths-ignore:
14 - '**.js'
15 - '**.md'
Ankush Menat6f2c9c62022-02-03 17:30:42 +053016 workflow_dispatch:
17 inputs:
18 user:
19 description: 'user'
20 required: true
21 default: 'frappe'
22 type: string
23 branch:
24 description: 'Branch name'
25 default: 'develop'
26 required: false
27 type: string
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053028
Ankush Menat9de0f752021-08-30 14:07:13 +053029concurrency:
Conord2074b12022-01-02 12:03:10 -060030 group: server-mariadb-develop-${{ github.event.number }}
Ankush Menat9de0f752021-08-30 14:07:13 +053031 cancel-in-progress: true
32
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053033jobs:
34 test:
Ankush Menat602374a2021-08-30 18:24:48 +053035 runs-on: ubuntu-latest
Ankush0bb60b32021-07-29 17:15:12 +053036 timeout-minutes: 60
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053037
38 strategy:
Suraj Shetty622bf072021-05-08 13:51:34 +053039 fail-fast: false
Mohammad Hasnain Mohsin Rajan46d54312021-03-15 11:17:19 +053040
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053041 matrix:
Suraj Shetty042118a2021-05-11 10:09:06 +053042 container: [1, 2, 3]
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053043
Suraj Shetty1f025a82021-05-12 18:14:22 +053044 name: Python Unit Tests
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053045
46 services:
47 mysql:
48 image: mariadb:10.3
49 env:
50 MYSQL_ALLOW_EMPTY_PASSWORD: YES
51 ports:
52 - 3306:3306
53 options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
54
55 steps:
56 - name: Clone
57 uses: actions/checkout@v2
58
59 - name: Setup Python
60 uses: actions/setup-python@v2
61 with:
Ankush Menat2854f632022-01-10 13:51:06 +053062 python-version: 3.8
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053063
Ankush Menate5e00702021-08-30 12:07:11 +053064 - name: Setup Node
65 uses: actions/setup-node@v2
66 with:
67 node-version: 14
68 check-latest: true
69
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053070 - name: Add to Hosts
71 run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
72
73 - name: Cache pip
74 uses: actions/cache@v2
75 with:
76 path: ~/.cache/pip
77 key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
78 restore-keys: |
79 ${{ runner.os }}-pip-
80 ${{ runner.os }}-
Suraj Shetty490aed22021-05-08 00:04:34 +053081
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053082 - name: Cache node modules
83 uses: actions/cache@v2
84 env:
85 cache-name: cache-node-modules
86 with:
87 path: ~/.npm
88 key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
89 restore-keys: |
90 ${{ runner.os }}-build-${{ env.cache-name }}-
91 ${{ runner.os }}-build-
92 ${{ runner.os }}-
Suraj Shetty490aed22021-05-08 00:04:34 +053093
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053094 - name: Get yarn cache directory path
95 id: yarn-cache-dir-path
96 run: echo "::set-output name=dir::$(yarn cache dir)"
97
98 - uses: actions/cache@v2
99 id: yarn-cache
100 with:
101 path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
102 key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
103 restore-keys: |
104 ${{ runner.os }}-yarn-
105
106 - name: Install
107 run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
Ankush Menat92c0dcc2021-10-20 14:43:39 +0530108 env:
Conord2074b12022-01-02 12:03:10 -0600109 DB: mariadb
Ankush Menat92c0dcc2021-10-20 14:43:39 +0530110 TYPE: server
Ankush Menat6f2c9c62022-02-03 17:30:42 +0530111 FRAPPE_USER: ${{ github.event.inputs.user }}
112 FRAPPE_BRANCH: ${{ github.event.inputs.branch }}
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +0530113
114 - name: Run Tests
Suraj Shetty7044bcf2021-05-09 11:29:00 +0530115 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 +0530116 env:
Suraj Shetty490aed22021-05-08 00:04:34 +0530117 TYPE: server
Suraj Shetty7044bcf2021-05-09 11:29:00 +0530118 CI_BUILD_ID: ${{ github.run_id }}
Suraj Shetty64083672021-05-10 23:48:37 +0530119 ORCHESTRATOR_URL: http://test-orchestrator.frappe.io
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +0530120
Suraj Shetty1fc8fcc2021-09-10 08:08:00 +0530121 - name: Upload coverage data
122 uses: codecov/codecov-action@v2
123 with:
124 name: MariaDB
125 fail_ci_if_error: true
126 files: /home/runner/frappe-bench/sites/coverage.xml
127 verbose: true