blob: f65b0001fe250875ce62380469aba7e864a429e5 [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:
Ankush Menate5e00702021-08-30 12:07:11 +053034 python-version: 3.7
35
36 - name: Setup Node
37 uses: actions/setup-node@v2
38 with:
39 node-version: 14
40 check-latest: true
Suraj Shetty490aed22021-05-08 00:04:34 +053041
42 - name: Add to Hosts
43 run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
44
45 - name: Cache pip
46 uses: actions/cache@v2
47 with:
48 path: ~/.cache/pip
49 key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
50 restore-keys: |
51 ${{ runner.os }}-pip-
52 ${{ runner.os }}-
53
54 - name: Cache node modules
55 uses: actions/cache@v2
56 env:
57 cache-name: cache-node-modules
58 with:
59 path: ~/.npm
60 key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
61 restore-keys: |
62 ${{ runner.os }}-build-${{ env.cache-name }}-
63 ${{ runner.os }}-build-
64 ${{ runner.os }}-
65
66 - name: Get yarn cache directory path
67 id: yarn-cache-dir-path
68 run: echo "::set-output name=dir::$(yarn cache dir)"
69
70 - uses: actions/cache@v2
71 id: yarn-cache
72 with:
73 path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
74 key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
75 restore-keys: |
76 ${{ runner.os }}-yarn-
77
78 - name: Install
79 run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
80
81 - name: Run Patch Tests
Gavin D'souzac68006b2021-06-03 20:05:00 +053082 run: |
83 cd ~/frappe-bench/
84 wget https://erpnext.com/files/v10-erpnext.sql.gz
85 bench --site test_site --force restore ~/frappe-bench/v10-erpnext.sql.gz
86 bench --site test_site migrate