Skip to content

print only specific workspace #7

print only specific workspace

print only specific workspace #7

name: Tests for Mergin Maps Media Sync
on:
push:
paths:
- "test/**"
- "**.py"
- ".github/workflows/tests_mergin_media_sync.yaml"
env:
TEST_MERGIN_URL: https://test.dev.merginmaps.com
TEST_API_USERNAME: test_media_sync
TEST_API_PASSWORD: ${{ secrets.TEST_API_PASSWORD }}
TEST_API_WORKSPACE: test-media-sync
TEST_MINIO_URL: 127.0.0.1:9000
TEST_MINIO_ACCESS_KEY: minioaccesskey
TEST_MINIO_SECRET_KEY: miniosecretkey
jobs:
Tests-for-Mergin-Maps-Media-Sync:
runs-on: ubuntu-latest
steps:
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install mergin-client pytest pytest-cov dynaconf psycopg2 minio
- name: Run MinIO Docker
run: |
docker run -d \
-p 127.0.0.1:9000:9000 \
-p 127.0.0.1:9001:9001 \
-e MINIO_ROOT_USER=$TEST_MINIO_ACCESS_KEY \
-e MINIO_ROOT_PASSWORD=$TEST_MINIO_SECRET_KEY \
--entrypoint /bin/bash \
minio/minio:latest -c "minio server /data --console-address :9001 --address :9000"
- name: Test MinIO
shell: python3 {0}
run: |
import os
from minio import Minio
client = Minio(
endpoint="127.0.0.1:9000",
access_key=os.environ.get('TEST_MINIO_ACCESS_KEY'),
secret_key=os.environ.get('TEST_MINIO_SECRET_KEY'),
secure=False,
)
print(client.list_buckets())
- name: Test Mergin Client
shell: python3 {0}
run: |
import os
from mergin import MerginClient
mc = MerginClient(os.environ.get('TEST_MERGIN_URL'),
login=os.environ.get('TEST_API_USERNAME'),
password=os.environ.get('TEST_API_PASSWORD'))
print(mc.projects_list(only_namespace=True, namespace=os.environ.get('TEST_API_WORKSPACE')))
# - name: Install Geodiff
# run: |
# sudo apt-get install libsqlite3-dev libpq-dev
# git clone https://github.com/MerginMaps/geodiff.git
# cd geodiff
# mkdir build && cd build
# cmake -DWITH_POSTGRESQL=TRUE ../geodiff
# sudo make install
# sudo cp geodiff /usr/local/bin
# - name: Check Geodiff version
# run: geodiff version
# - name: Checkout
# uses: actions/checkout@v4
# - name: Run tests
# run: |
# pytest test --cov=. --cov-report=term-missing:skip-covered -vv
# - name: Check files using the black formatter
# uses: rickstaa/action-black@v1
# id: action_black
# with:
# black_args: "."