From e74dcf9c555c4a16b2740b3ec4dbf8ffbdebc0fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lie=20Bouttier?= Date: Thu, 17 Oct 2024 14:38:30 +0200 Subject: [PATCH] use reusable pytest action from geonature --- .github/workflows/pytest.yml | 118 +----------------------- .gitmodules | 9 -- dependencies/GeoNature | 1 - dependencies/Utils-Flask-SQLAlchemy | 1 - dependencies/Utils-Flask-SQLAlchemy-Geo | 1 - requirements-dev.in | 2 - 6 files changed, 4 insertions(+), 128 deletions(-) delete mode 100644 .gitmodules delete mode 160000 dependencies/GeoNature delete mode 160000 dependencies/Utils-Flask-SQLAlchemy delete mode 160000 dependencies/Utils-Flask-SQLAlchemy-Geo delete mode 100644 requirements-dev.in diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 78e2262..4c2adcc 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -3,122 +3,12 @@ name: pytest on: push: branches: - - master - - hotfixes + - main - develop - - workshop pull_request: - branches: - - master - - hotfixes - - develop - - workshop jobs: build: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - debian-version: ["11", "12"] - include: - - debian-version: "11" - python-version: "3.9" - postgres-version: 13 - postgis-version: 3.2 - - debian-version: "12" - python-version: "3.9" - postgres-version: 15 - postgis-version: 3.3 - - name: Debian ${{ matrix.debian-version }} - - services: - postgres: - image: postgis/postgis:${{ matrix.postgres-version }}-${{ matrix.postgis-version }} - env: - POSTGRES_DB: geonature2db - POSTGRES_PASSWORD: geonatpasswd - POSTGRES_USER: geonatadmin - ports: - - 5432:5432 - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - redis: - image: redis - ports: - - 6379:6379 - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - - steps: - - name: Add postgis_raster database extension - if: ${{ matrix.postgis-version >= 3 }} - run: | - psql -h localhost -U geonatadmin -d geonature2db -tc 'CREATE EXTENSION "postgis_raster";' - env: - PGPASSWORD: geonatpasswd - - name: Add database extensions - run: | - psql -h localhost -U geonatadmin -d geonature2db -tc 'CREATE EXTENSION "hstore";' - psql -h localhost -U geonatadmin -d geonature2db -tc 'CREATE EXTENSION "uuid-ossp";' - psql -h localhost -U geonatadmin -d geonature2db -tc 'CREATE EXTENSION "pg_trgm";' - psql -h localhost -U geonatadmin -d geonature2db -tc 'CREATE EXTENSION "unaccent";' - env: - PGPASSWORD: geonatpasswd - - uses: actions/checkout@v2 - with: - submodules: recursive - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install GDAL - run: | - sudo apt update - sudo apt install -y libgdal-dev - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install \ - -e ..[tests] \ - -r requirements-dev.txt - working-directory: ./dependencies/GeoNature/backend - - name: Install database - run: | - geonature db upgrade geonature@head -x local-srid=2154 - geonature db autoupgrade -x local-srid=2154 - geonature taxref import-v15 --skip-bdc-statuts - geonature db upgrade geonature-samples@head - geonature db upgrade nomenclatures_taxonomie_data@head - geonature db upgrade ref_geo_fr_departments@head - geonature db upgrade ref_geo_fr_municipalities@head - geonature db upgrade ref_geo_inpn_grids_10@head - env: - GEONATURE_CONFIG_FILE: dependencies/GeoNature/config/test_config.toml - - name: Install export module backend - run: | - pip install -r requirements-dev.in - pip install . - - name: Install import module database - run: | - geonature upgrade-modules-db EXPORTS - env: - GEONATURE_CONFIG_FILE: dependencies/GeoNature/config/test_config.toml - - name: Test with pytest - run: | - pytest -v --cov --cov-report xml - env: - GEONATURE_CONFIG_FILE: dependencies/GeoNature/config/test_config.toml - - name: Upload coverage to Codecov - if: ${{ matrix.name == 'Debian 11' }} - uses: codecov/codecov-action@v2 - with: - flags: pytest + uses: pnx-si/geonature/.github/workflows/gn-module-pytest.yml@feat/gn-module-pytest + with: + geonature_ref: "ec1f160330a211a7debca96545dba67d602ff5ca" diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index dbd9c2d..0000000 --- a/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "dependencies/GeoNature"] - path = dependencies/GeoNature - url = ../GeoNature.git -[submodule "dependencies/Utils-Flask-SQLAlchemy"] - path = dependencies/Utils-Flask-SQLAlchemy - url = ../Utils-Flask-SQLAlchemy.git -[submodule "dependencies/Utils-Flask-SQLAlchemy-Geo"] - path = dependencies/Utils-Flask-SQLAlchemy-Geo - url = ../Utils-Flask-SQLAlchemy-Geo.git diff --git a/dependencies/GeoNature b/dependencies/GeoNature deleted file mode 160000 index ec1f160..0000000 --- a/dependencies/GeoNature +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ec1f160330a211a7debca96545dba67d602ff5ca diff --git a/dependencies/Utils-Flask-SQLAlchemy b/dependencies/Utils-Flask-SQLAlchemy deleted file mode 160000 index 106a75c..0000000 --- a/dependencies/Utils-Flask-SQLAlchemy +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 106a75cc608838f55288f42fdfe443da97be40a5 diff --git a/dependencies/Utils-Flask-SQLAlchemy-Geo b/dependencies/Utils-Flask-SQLAlchemy-Geo deleted file mode 160000 index 2b5002b..0000000 --- a/dependencies/Utils-Flask-SQLAlchemy-Geo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2b5002bf13762d1c49b5d18516cd72d82861f12c diff --git a/requirements-dev.in b/requirements-dev.in deleted file mode 100644 index 928e0b1..0000000 --- a/requirements-dev.in +++ /dev/null @@ -1,2 +0,0 @@ -rdflib --r dependencies/GeoNature/backend/requirements-common.in \ No newline at end of file