blob: 7347a5856a2b4a3704d755e5726a8b82c595d38c [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 workflow_dispatch:
10 push:
11 branches: [ develop ]
Ankush Menat8a6b82b2021-08-13 12:59:27 +053012 paths-ignore:
13 - '**.js'
14 - '**.md'
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053015
Ankush Menat9de0f752021-08-30 14:07:13 +053016concurrency:
Conord2074b12022-01-02 12:03:10 -060017 group: server-mariadb-develop-${{ github.event.number }}
Ankush Menat9de0f752021-08-30 14:07:13 +053018 cancel-in-progress: true
19
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053020jobs:
21 test:
Ankush Menat602374a2021-08-30 18:24:48 +053022 runs-on: ubuntu-latest
Ankush0bb60b32021-07-29 17:15:12 +053023 timeout-minutes: 60
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053024
25 strategy:
Suraj Shetty622bf072021-05-08 13:51:34 +053026 fail-fast: false
Mohammad Hasnain Mohsin Rajan46d54312021-03-15 11:17:19 +053027
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053028 matrix:
Suraj Shetty042118a2021-05-11 10:09:06 +053029 container: [1, 2, 3]
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053030
Suraj Shetty1f025a82021-05-12 18:14:22 +053031 name: Python Unit Tests
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053032
33 services:
34 mysql:
35 image: mariadb:10.3
36 env:
37 MYSQL_ALLOW_EMPTY_PASSWORD: YES
38 ports:
39 - 3306:3306
40 options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
41
42 steps:
43 - name: Clone
44 uses: actions/checkout@v2
45
46 - name: Setup Python
47 uses: actions/setup-python@v2
48 with:
Ankush Menat2854f632022-01-10 13:51:06 +053049 python-version: 3.8
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053050
Ankush Menate5e00702021-08-30 12:07:11 +053051 - name: Setup Node
52 uses: actions/setup-node@v2
53 with:
54 node-version: 14
55 check-latest: true
56
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053057 - name: Add to Hosts
58 run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
59
60 - name: Cache pip
61 uses: actions/cache@v2
62 with:
63 path: ~/.cache/pip
64 key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
65 restore-keys: |
66 ${{ runner.os }}-pip-
67 ${{ runner.os }}-
Suraj Shetty490aed22021-05-08 00:04:34 +053068
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053069 - name: Cache node modules
70 uses: actions/cache@v2
71 env:
72 cache-name: cache-node-modules
73 with:
74 path: ~/.npm
75 key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
76 restore-keys: |
77 ${{ runner.os }}-build-${{ env.cache-name }}-
78 ${{ runner.os }}-build-
79 ${{ runner.os }}-
Suraj Shetty490aed22021-05-08 00:04:34 +053080
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053081 - name: Get yarn cache directory path
82 id: yarn-cache-dir-path
83 run: echo "::set-output name=dir::$(yarn cache dir)"
84
85 - uses: actions/cache@v2
86 id: yarn-cache
87 with:
88 path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
89 key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
90 restore-keys: |
91 ${{ runner.os }}-yarn-
92
93 - name: Install
94 run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
Ankush Menat92c0dcc2021-10-20 14:43:39 +053095 env:
Conord2074b12022-01-02 12:03:10 -060096 DB: mariadb
Ankush Menat92c0dcc2021-10-20 14:43:39 +053097 TYPE: server
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053098
99 - name: Run Tests
Suraj Shetty7044bcf2021-05-09 11:29:00 +0530100 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 +0530101 env:
Suraj Shetty490aed22021-05-08 00:04:34 +0530102 TYPE: server
Suraj Shetty7044bcf2021-05-09 11:29:00 +0530103 CI_BUILD_ID: ${{ github.run_id }}
Suraj Shetty64083672021-05-10 23:48:37 +0530104 ORCHESTRATOR_URL: http://test-orchestrator.frappe.io
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +0530105
Suraj Shetty1fc8fcc2021-09-10 08:08:00 +0530106 - name: Upload coverage data
107 uses: codecov/codecov-action@v2
108 with:
109 name: MariaDB
110 fail_ci_if_error: true
111 files: /home/runner/frappe-bench/sites/coverage.xml
112 verbose: true