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