blob: 72d4028ce6e1442941c15ed2a2e30323e7763d02 [file] [log] [blame]
Suraj Shetty490aed22021-05-08 00:04:34 +05301name: Patch
2
Ankush Menat8a6b82b2021-08-13 12:59:27 +05303on:
4 pull_request:
5 paths-ignore:
6 - '**.js'
7 - '**.md'
8 workflow_dispatch:
9
Suraj Shetty490aed22021-05-08 00:04:34 +053010
11jobs:
12 test:
13 runs-on: ubuntu-18.04
Ankush0bb60b32021-07-29 17:15:12 +053014 timeout-minutes: 60
Suraj Shetty490aed22021-05-08 00:04:34 +053015
16 name: Patch Test
17
18 services:
19 mysql:
20 image: mariadb:10.3
21 env:
22 MYSQL_ALLOW_EMPTY_PASSWORD: YES
23 ports:
24 - 3306:3306
25 options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
26
27 steps:
28 - name: Clone
29 uses: actions/checkout@v2
30
31 - name: Setup Python
32 uses: actions/setup-python@v2
33 with:
34 python-version: 3.6
35
36 - name: Add to Hosts
37 run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
38
39 - name: Cache pip
40 uses: actions/cache@v2
41 with:
42 path: ~/.cache/pip
43 key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
44 restore-keys: |
45 ${{ runner.os }}-pip-
46 ${{ runner.os }}-
47
48 - name: Cache node modules
49 uses: actions/cache@v2
50 env:
51 cache-name: cache-node-modules
52 with:
53 path: ~/.npm
54 key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
55 restore-keys: |
56 ${{ runner.os }}-build-${{ env.cache-name }}-
57 ${{ runner.os }}-build-
58 ${{ runner.os }}-
59
60 - name: Get yarn cache directory path
61 id: yarn-cache-dir-path
62 run: echo "::set-output name=dir::$(yarn cache dir)"
63
64 - uses: actions/cache@v2
65 id: yarn-cache
66 with:
67 path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
68 key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
69 restore-keys: |
70 ${{ runner.os }}-yarn-
71
72 - name: Install
73 run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
74
75 - name: Run Patch Tests
Gavin D'souzac68006b2021-06-03 20:05:00 +053076 run: |
77 cd ~/frappe-bench/
78 wget https://erpnext.com/files/v10-erpnext.sql.gz
79 bench --site test_site --force restore ~/frappe-bench/v10-erpnext.sql.gz
80 bench --site test_site migrate