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