|
5 | 5 | push: |
6 | 6 | branches: |
7 | 7 | - develop |
| 8 | + - version-16 |
8 | 9 | - version-15 |
9 | 10 | pull_request: |
10 | 11 | branches: |
11 | 12 | - develop |
| 13 | + - version-16 |
12 | 14 | - version-15 |
13 | 15 |
|
14 | 16 | concurrency: |
15 | | - group: develop-erpnext_sumup-${{ github.event.number }} |
| 17 | + group: ${{ github.workflow }}-${{ github.ref }} |
16 | 18 | cancel-in-progress: true |
17 | 19 |
|
18 | 20 | jobs: |
19 | | - tests: |
| 21 | + tests_v16: |
| 22 | + if: ${{ (github.event_name == 'pull_request' && (github.base_ref == 'develop' || github.base_ref == 'version-16')) || (github.event_name != 'pull_request' && (github.ref_name == 'develop' || github.ref_name == 'version-16')) }} |
20 | 23 | runs-on: ubuntu-latest |
21 | | - strategy: |
22 | | - fail-fast: false |
23 | | - name: Server |
| 24 | + name: Server (v16) |
| 25 | + |
| 26 | + services: |
| 27 | + redis-cache: |
| 28 | + image: redis:alpine |
| 29 | + ports: |
| 30 | + - 13000:6379 |
| 31 | + redis-queue: |
| 32 | + image: redis:alpine |
| 33 | + ports: |
| 34 | + - 11000:6379 |
| 35 | + mariadb: |
| 36 | + image: mariadb:10.6 |
| 37 | + env: |
| 38 | + MYSQL_ROOT_PASSWORD: root |
| 39 | + ports: |
| 40 | + - 3306:3306 |
| 41 | + options: --health-cmd="mariadb-admin ping" --health-interval=5s --health-timeout=2s --health-retries=3 |
| 42 | + |
| 43 | + steps: |
| 44 | + - name: Clone |
| 45 | + uses: actions/checkout@v3 |
| 46 | + |
| 47 | + - name: Find tests |
| 48 | + run: | |
| 49 | + echo "Finding tests" |
| 50 | + grep -rn "def test" > /dev/null |
| 51 | +
|
| 52 | + - name: Setup Python |
| 53 | + uses: actions/setup-python@v4 |
| 54 | + with: |
| 55 | + python-version: '3.14' |
| 56 | + |
| 57 | + - name: Setup Node |
| 58 | + uses: actions/setup-node@v3 |
| 59 | + with: |
| 60 | + node-version: 24 |
| 61 | + check-latest: true |
| 62 | + |
| 63 | + - name: Cache pip |
| 64 | + uses: actions/cache@v4 |
| 65 | + with: |
| 66 | + path: ~/.cache/pip |
| 67 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py', '**/setup.cfg') }} |
| 68 | + restore-keys: | |
| 69 | + ${{ runner.os }}-pip- |
| 70 | + ${{ runner.os }}- |
| 71 | +
|
| 72 | + - name: Get yarn cache directory path |
| 73 | + id: yarn-cache-dir-path |
| 74 | + run: 'echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT' |
| 75 | + |
| 76 | + - uses: actions/cache@v4 |
| 77 | + id: yarn-cache |
| 78 | + with: |
| 79 | + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} |
| 80 | + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| 81 | + restore-keys: | |
| 82 | + ${{ runner.os }}-yarn- |
| 83 | +
|
| 84 | + - name: Update Package Repository |
| 85 | + run: sudo apt update |
| 86 | + |
| 87 | + - name: Install MariaDB Client |
| 88 | + run: sudo apt-get install mariadb-client |
| 89 | + |
| 90 | + - name: Setup |
| 91 | + run: | |
| 92 | + pip install frappe-bench |
| 93 | + bench init --frappe-branch version-16 --skip-redis-config-generation --skip-assets --python "$(which python)" ~/frappe-bench |
| 94 | + mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'" |
| 95 | + mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'" |
| 96 | +
|
| 97 | + - name: Install |
| 98 | + working-directory: /home/runner/frappe-bench |
| 99 | + run: | |
| 100 | + bench get-app --branch version-16 erpnext |
| 101 | + bench get-app erpnext_sumup $GITHUB_WORKSPACE |
| 102 | + bench setup requirements --dev |
| 103 | + bench new-site --db-root-password root --admin-password admin test_site |
| 104 | + bench --site test_site install-app erpnext |
| 105 | + bench --site test_site install-app erpnext_sumup |
| 106 | + bench build |
| 107 | + env: |
| 108 | + CI: 'Yes' |
| 109 | + |
| 110 | + - name: Migrate |
| 111 | + working-directory: /home/runner/frappe-bench |
| 112 | + run: | |
| 113 | + bench --site test_site migrate |
| 114 | +
|
| 115 | + - name: Run Tests |
| 116 | + working-directory: /home/runner/frappe-bench |
| 117 | + run: | |
| 118 | + bench --site test_site set-config allow_tests true |
| 119 | + bench --site test_site run-tests --app erpnext_sumup --skip-test-records |
| 120 | + env: |
| 121 | + TYPE: server |
| 122 | + |
| 123 | + tests_v15: |
| 124 | + if: ${{ (github.event_name == 'pull_request' && github.base_ref == 'version-15') || (github.event_name != 'pull_request' && github.ref_name == 'version-15') }} |
| 125 | + runs-on: ubuntu-latest |
| 126 | + name: Server (v15) |
24 | 127 |
|
25 | 128 | services: |
26 | 129 | redis-cache: |
@@ -105,8 +208,8 @@ jobs: |
105 | 208 | bench build |
106 | 209 | env: |
107 | 210 | CI: 'Yes' |
108 | | - |
109 | | - - name: Migrate |
| 211 | + |
| 212 | + - name: Migrate |
110 | 213 | working-directory: /home/runner/frappe-bench |
111 | 214 | run: | |
112 | 215 | bench --site test_site migrate |
|
0 commit comments