Merge pull request #123 from 3dgeo-heidelberg/labeled_pcs #261
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test with MongoDB | |
on: | |
push: | |
branches: [ main, dev ] | |
pull_request: | |
branches: [ main, dev ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
max-parallel: 1 | |
matrix: | |
python-version: ['3.8', '3.9'] | |
mongodb-version: ['4.2', '4.4', '5.0'] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: MongoDB in GitHub Actions | |
uses: supercharge/mongodb-github-action@1.7.0 | |
with: | |
mongodb-version: ${{ matrix.mongodb-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements_dev.txt | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Test pytreedb with pytest | |
env: | |
CONN_URI: "mongodb://127.0.0.1:27017/" | |
CONN_DB: "pytreedb" | |
CONN_COL: "test" | |
run: | | |
python -m pytest pytreedb | |
- name: Test pytreedb-server with pytest | |
env: | |
CONN_URI: "mongodb://127.0.0.1:27017/" | |
CONN_DB: "pytreedb" | |
CONN_COL: "test_server" | |
FLASK_RUN: "1" | |
FLASK_RUN_HOST: "127.0.0.1" | |
FLASK_RUN_PORT: "12789" | |
PYTREEDB_FILENAME: "pytree.db" | |
PYTREEDB_DOWNLOAD: "https://github.com/3dgeo-heidelberg/pytreedb/raw/main/data/test/geojsons.zip" | |
run: | | |
python -m pytest webserver/pytreedb_server | |
- name: Test pytreedb-server ON CLOUD with pytest | |
continue-on-error: true | |
env: | |
CONN_URI: ${{ secrets.CONN_URI }} | |
CONN_DB: ${{ secrets.CONN_DB }} | |
CONN_COL: "test_server" | |
FLASK_RUN: "1" | |
FLASK_RUN_HOST: "127.0.0.1" | |
FLASK_RUN_PORT: "12789" | |
PYTREEDB_FILENAME: "pytree.db" | |
PYTREEDB_DOWNLOAD: "https://github.com/3dgeo-heidelberg/pytreedb/raw/main/data/test/geojsons.zip" | |
run: | | |
python -m pytest webserver/pytreedb_server | |
- name: Test pytreedb-server on pytreedb.geog.uni-heidelberg.de with pytest (using SSL) | |
continue-on-error: true | |
env: | |
FLASK_RUN: "0" | |
FLASK_RUN_HOST: "https://pytreedb.geog.uni-heidelberg.de" | |
FLASK_RUN_PORT: "443" | |
run: | | |
python -m pytest webserver/pytreedb_server | |
- name: Test pytreedb-server on pytreedb.geog.uni-heidelberg.de with pytest (not using SSL) | |
continue-on-error: true | |
env: | |
FLASK_RUN: "0" | |
FLASK_RUN_HOST: "http://pytreedb.geog.uni-heidelberg.de" | |
FLASK_RUN_PORT: "80" | |
run: | | |
python -m pytest webserver/pytreedb_server | |
- name: build sphinx doc | |
run: | | |
cd doc | |
make html |