diff --git a/.github/workflows/auto_tests.yml b/.github/workflows/auto_tests.yml new file mode 100644 index 00000000..53325525 --- /dev/null +++ b/.github/workflows/auto_tests.yml @@ -0,0 +1,43 @@ +name: Auto Tests + +on: push + +jobs: + server_tests: + runs-on: ubuntu-20.04 + + services: + postgres: + image: postgres:14 + env: + POSTGRES_DB: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_USER: postgres + ports: + - 5435:5432 + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - name: Check out repository + uses: actions/checkout@v3 + + - name: Install deps + run: | + cd server + sudo apt-get -y install pipenv libsqlite3-mod-spatialite + pipenv install --dev --three --sequential --verbose + + - name: Run tests + run: | + cd server + pipenv run pytest -v --cov=mergin mergin/tests + + - name: Coveralls + uses: coverallsapp/github-action@v2 + with: + base-path: server diff --git a/README.md b/README.md index b0d6fc4f..8e108e6e 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@

- Store and track changes to your geo-data + Store and track changes to your geo-data
+

-

-
[![Code Layout](https://github.com/MerginMaps/mergin/actions/workflows/code_style.yml/badge.svg)](https://github.com/MerginMaps/mergin/actions/workflows/code_style.yml) -

+[![Auto Tests](https://github.com/MerginMaps/mergin/actions/workflows/auto_tests.yml/badge.svg)](https://github.com/MerginMaps/mergin/actions/workflows/auto_tests.yml) +[![Coverage Status](https://coveralls.io/repos/github/MerginMaps/mergin/badge.svg)](https://coveralls.io/github/MerginMaps/mergin) ## About diff --git a/development.md b/development.md index a76f0b1f..f01a4ed8 100644 --- a/development.md +++ b/development.md @@ -39,5 +39,6 @@ To launch the unit tests run: ```shell $ docker run -d --rm --name testing_pg -p 5435:5432 -e POSTGRES_PASSWORD=postgres postgres:14 $ cd server +$ pipenv install --dev --three --sequential --verbose $ pipenv run pytest -v --cov=mergin mergin/tests ```