Skip to content

Commit d58a2d9

Browse files
committed
add manual dispatch to specify branch for geodiff and mergin-py-client - defaults to master geodiff and install of client from PyPi branch is not specified
1 parent 5fb80ac commit d58a2d9

1 file changed

Lines changed: 25 additions & 13 deletions

File tree

.github/workflows/tests_mergin_db_sync.yaml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,22 @@ name: Tests for Mergin DB Sync
33
on:
44
push:
55
paths:
6-
- "test/**"
7-
- "**.py"
8-
- "requirements.txt"
9-
- "requirements-dev.txt"
10-
- "pyproject.toml"
11-
- ".github/workflows/tests_mergin_db_sync.yaml"
6+
- "test/**"
7+
- "**.py"
8+
- "requirements.txt"
9+
- "requirements-dev.txt"
10+
- "pyproject.toml"
11+
- ".github/workflows/tests_mergin_db_sync.yaml"
12+
workflow_dispatch:
13+
inputs:
14+
geodiff_branch:
15+
description: "Geodiff branch to compile (default: master)"
16+
required: false
17+
default: "master"
18+
mergin_client_branch:
19+
description: "Mergin Python client branch from GitHub (leave empty to install from pip)"
20+
required: false
21+
default: ""
1222

1323
env:
1424
TEST_GEODIFF_EXE: geodiff
@@ -19,9 +29,7 @@ env:
1929
TEST_API_WORKSPACE: test-db-sync
2030

2131
jobs:
22-
2332
Tests-for-Mergin-DB-Sync:
24-
2533
runs-on: ubuntu-latest
2634

2735
services:
@@ -36,20 +44,19 @@ jobs:
3644
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
3745

3846
steps:
39-
4047
- name: Install Geodiff
4148
run: |
4249
sudo apt-get install libsqlite3-dev libpq-dev
43-
git clone https://github.com/MerginMaps/geodiff.git
50+
git clone --branch ${{ inputs.geodiff_branch || 'master' }} https://github.com/MerginMaps/geodiff.git
4451
cd geodiff
4552
mkdir build && cd build
4653
cmake -DWITH_POSTGRESQL=TRUE ../geodiff
4754
sudo make install
48-
sudo cp geodiff /usr/local/bin
55+
sudo cp geodiff /usr/local/bin
4956
50-
- name: Check Geodiff version
57+
- name: Check Geodiff version
5158
run: geodiff version
52-
59+
5360
- name: Checkout
5461
uses: actions/checkout@v4
5562

@@ -59,6 +66,11 @@ jobs:
5966
python3 -m pip install -r requirements.txt
6067
python3 -m pip install -r requirements-dev.txt
6168
69+
- name: Install Mergin client from GitHub
70+
if: ${{ inputs.mergin_client_branch != '' }}
71+
run: |
72+
python3 -m pip install git+https://github.com/MerginMaps/python-api-client.git@${{ inputs.mergin_client_branch }}
73+
6274
- name: Run tests
6375
run: |
6476
pytest test --cov=. --cov-report=term-missing:skip-covered -vv

0 commit comments

Comments
 (0)