Conor | d2074b1 | 2022-01-02 12:03:10 -0600 | [diff] [blame] | 1 | name: Server (Postgres) |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 2 | |
Suraj Shetty | 9768783 | 2021-05-28 13:39:53 +0530 | [diff] [blame] | 3 | on: |
| 4 | pull_request: |
Ankush Menat | 8a6b82b | 2021-08-13 12:59:27 +0530 | [diff] [blame] | 5 | paths-ignore: |
| 6 | - '**.js' |
| 7 | - '**.md' |
Conor | d2074b1 | 2022-01-02 12:03:10 -0600 | [diff] [blame] | 8 | - '**.html' |
| 9 | types: [opened, labelled, synchronize, reopened] |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 10 | |
Ankush Menat | 9de0f75 | 2021-08-30 14:07:13 +0530 | [diff] [blame] | 11 | concurrency: |
Conor | d2074b1 | 2022-01-02 12:03:10 -0600 | [diff] [blame] | 12 | group: server-postgres-develop-${{ github.event.number }} |
Ankush Menat | 9de0f75 | 2021-08-30 14:07:13 +0530 | [diff] [blame] | 13 | cancel-in-progress: true |
| 14 | |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 15 | jobs: |
| 16 | test: |
Conor | d2074b1 | 2022-01-02 12:03:10 -0600 | [diff] [blame] | 17 | if: ${{ contains(github.event.pull_request.labels.*.name, 'postgres') }} |
Ankush Menat | 602374a | 2021-08-30 18:24:48 +0530 | [diff] [blame] | 18 | runs-on: ubuntu-latest |
Ankush | 0bb60b3 | 2021-07-29 17:15:12 +0530 | [diff] [blame] | 19 | timeout-minutes: 60 |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 20 | |
| 21 | strategy: |
Suraj Shetty | 622bf07 | 2021-05-08 13:51:34 +0530 | [diff] [blame] | 22 | fail-fast: false |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 23 | matrix: |
Conor | d2074b1 | 2022-01-02 12:03:10 -0600 | [diff] [blame] | 24 | container: [1, 2, 3] |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 25 | |
Suraj Shetty | 1f025a8 | 2021-05-12 18:14:22 +0530 | [diff] [blame] | 26 | name: Python Unit Tests |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 27 | |
| 28 | services: |
Conor | d2074b1 | 2022-01-02 12:03:10 -0600 | [diff] [blame] | 29 | postgres: |
| 30 | image: postgres:13.3 |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 31 | env: |
Conor | d2074b1 | 2022-01-02 12:03:10 -0600 | [diff] [blame] | 32 | POSTGRES_PASSWORD: travis |
| 33 | options: >- |
| 34 | --health-cmd pg_isready |
| 35 | --health-interval 10s |
| 36 | --health-timeout 5s |
| 37 | --health-retries 5 |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 38 | ports: |
Conor | d2074b1 | 2022-01-02 12:03:10 -0600 | [diff] [blame] | 39 | - 5432:5432 |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 40 | |
| 41 | steps: |
Conor | d2074b1 | 2022-01-02 12:03:10 -0600 | [diff] [blame] | 42 | |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 43 | - name: Clone |
| 44 | uses: actions/checkout@v2 |
| 45 | |
| 46 | - name: Setup Python |
| 47 | uses: actions/setup-python@v2 |
| 48 | with: |
Ankush Menat | 2854f63 | 2022-01-10 13:51:06 +0530 | [diff] [blame] | 49 | python-version: 3.8 |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 50 | |
Ankush Menat | e5e0070 | 2021-08-30 12:07:11 +0530 | [diff] [blame] | 51 | - name: Setup Node |
| 52 | uses: actions/setup-node@v2 |
| 53 | with: |
| 54 | node-version: 14 |
| 55 | check-latest: true |
| 56 | |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 57 | - 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 Shetty | 490aed2 | 2021-05-08 00:04:34 +0530 | [diff] [blame] | 68 | |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 69 | - 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 Shetty | 490aed2 | 2021-05-08 00:04:34 +0530 | [diff] [blame] | 80 | |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 81 | - 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 | |
Conor | d2074b1 | 2022-01-02 12:03:10 -0600 | [diff] [blame] | 93 | |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 94 | - name: Install |
| 95 | run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh |
Ankush Menat | 92c0dcc | 2021-10-20 14:43:39 +0530 | [diff] [blame] | 96 | env: |
Conor | d2074b1 | 2022-01-02 12:03:10 -0600 | [diff] [blame] | 97 | DB: postgres |
Ankush Menat | 92c0dcc | 2021-10-20 14:43:39 +0530 | [diff] [blame] | 98 | TYPE: server |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 99 | |
| 100 | - name: Run Tests |
Conor | d2074b1 | 2022-01-02 12:03:10 -0600 | [diff] [blame] | 101 | run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --use-orchestrator |
Mohammad Hasnain Mohsin Rajan | 0f60f08 | 2021-03-12 14:09:52 +0530 | [diff] [blame] | 102 | env: |
Suraj Shetty | 490aed2 | 2021-05-08 00:04:34 +0530 | [diff] [blame] | 103 | TYPE: server |
Suraj Shetty | 7044bcf | 2021-05-09 11:29:00 +0530 | [diff] [blame] | 104 | CI_BUILD_ID: ${{ github.run_id }} |
Suraj Shetty | 6408367 | 2021-05-10 23:48:37 +0530 | [diff] [blame] | 105 | ORCHESTRATOR_URL: http://test-orchestrator.frappe.io |