Skip to content

Commit

Permalink
Merge branch 'develop' into user-conf-account-form
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrieuclp committed Sep 27, 2023
2 parents 7843296 + fe11097 commit 2e6c5e0
Show file tree
Hide file tree
Showing 474 changed files with 30,907 additions and 34,117 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# prettier always
f9516aca57f53732806778ab261ae0d18d9daab8

# prettier again
d6b71d6e4c075792f7885b4acb747049e496dc76

Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/rapport-de-bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Version de GeoNature affectée par le bug.
**Description du bug**
Description du problème rencontré (message d’erreur, code HTTP de retour inattendu, …).

**Comportement attendue**
Description du comportement attendue en lieu et place du problème rencontré.
**Comportement attendu**
Description du comportement attendu en lieu et place du problème rencontré.

**Comment reproduire**
Étapes à suivre pour reproduire le problème (sur quelle page se rendre, sur quel bouton cliquer, avec quelles données présentes, …).
Expand Down
57 changes: 24 additions & 33 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- master
- hotfixes
- develop
- fixtestfront
pull_request:
branches:
- master
Expand Down Expand Up @@ -37,19 +38,16 @@ jobs:
psql -h localhost -U geonatadmin -d geonature2db -tc 'CREATE EXTENSION "postgis_raster";'
env:
PGPASSWORD: geonatpasswd
- uses: actions/checkout@v3
with:
submodules: recursive
- 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";'
psql -h localhost -U geonatadmin -d geonature2db -f install/assets/db/add_pg_extensions.sql
env:
PGPASSWORD: geonatpasswd
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python 3.9
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
# cache: 'pip'
Expand All @@ -59,7 +57,7 @@ jobs:
sudo apt install -y libgdal-dev
- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
Expand All @@ -75,47 +73,41 @@ jobs:
working-directory: ./backend
- name: Install database
run: |
geonature db upgrade geonature@head -x local-srid=2154
geonature db autoupgrade -x local-srid=2154
geonature db upgrade geonature-samples@head
geonature db upgrade taxhub@head
geonature taxref import-v15 --skip-bdc-statuts
geonature db upgrade nomenclatures_taxonomie_data@head
geonature db upgrade ref_geo_fr_departments@head
env:
GEONATURE_CONFIG_FILE: config/test_config.toml
- name: Install core modules
run: |
geonature install-gn-module contrib/occtax OCCTAX --build=false
geonature db upgrade occtax-samples-test@head
geonature install-gn-module contrib/gn_module_occhab OCCHAB --build=false
geonature db upgrade occhab-samples@head
geonature install-gn-module contrib/gn_module_validation VALIDATION --build=false
install/03b_populate_db_for_test.sh
env:
GEONATURE_CONFIG_FILE: config/test_config.toml
# FRONTEND
- name: Cache node modules
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: install frontend
- name: generate frontend config
run: |
cp ./config/settings.ini.sample ./config/settings.ini
geonature generate_frontend_config
./install/05_install_frontend.sh --ci
env:
GEONATURE_CONFIG_FILE: config/test_config.toml
GEONATURE_CONFIG_FILE: "${{ github.workspace }}/config/test_config.toml"
- name: Show generated frontend config
run: |
cat ./frontend/src/conf/app.config.ts
- name: Install core modules
run: |
geonature install-gn-module contrib/occtax OCCTAX --build=false
geonature db upgrade occtax-samples-test@head
geonature install-gn-module contrib/gn_module_occhab OCCHAB --build=false
geonature db upgrade occhab-samples@head
geonature install-gn-module contrib/gn_module_validation VALIDATION --build=false
geonature permissions supergrant --group --nom "Grp_admin" --yes
env:
GEONATURE_CONFIG_FILE: config/test_config.toml
- name: Run GeoNature backend
run: geonature dev_back &
env:
Expand All @@ -127,14 +119,13 @@ jobs:
TAXHUB_SETTINGS: test_config.py
TAXHUB_SQLALCHEMY_DATABASE_URI: "postgresql://geonatadmin:[email protected]:5432/geonature2db"
- name: Cypress run
uses: cypress-io/github-action@v4
uses: cypress-io/github-action@v5
with:
record: ${{ fromJSON(github.ref_name == 'master') }}
record: false
working-directory: ./frontend
start: npm run start
wait-on: http://127.0.0.1:4200
headless: true
env:
is_master:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143 changes: 55 additions & 88 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ jobs:
build-backend:
name: Build backend image
runs-on: ubuntu-latest
outputs:
image_name: ${{ fromJSON(steps.build-prod.outputs.metadata)['image.name'] }}
image_digest: ${{ steps.build-prod.outputs.digest }}
steps:
-
name: Checkout
Expand Down Expand Up @@ -45,7 +42,7 @@ jobs:
-
name: Build and export wheels image
id: build-wheels
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
file: ./backend/Dockerfile
Expand All @@ -65,123 +62,93 @@ jobs:
-
name: Build and export prod image
id: build-prod
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
file: ./backend/Dockerfile
target: prod-full
target: prod
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-prod.outputs.tags }}
labels: ${{ steps.meta-prod.outputs.labels }}

frontend-config:
name: Generate frontend config
runs-on: ubuntu-latest
needs: build-backend
container: ${{ needs.build-backend.outputs.image_name }}@${{ needs.build-backend.outputs.image_digest }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Generate frontend configuration
run: |
geonature generate-frontend-config --input frontend/src/conf/app.config.ts.sample --output frontend/src/conf/app.config.ts
geonature generate-frontend-module-config OCCTAX --output contrib/occtax/frontend/app/module.config.ts
geonature generate-frontend-module-config OCCHAB --output contrib/gn_module_occhab/frontend/app/module.config.ts
geonature generate-frontend-module-config VALIDATION --output contrib/gn_module_validation/frontend/app/module.config.ts
env:
GEONATURE_SQLALCHEMY_DATABASE_URI: "postgresql://pguser:pgpass@localhost:5432/dbname"
GEONATURE_SECRET_KEY: "this is in fact not used in this action"
GEONATURE_API_ENDPOINT: "http://127.0.0.1:8000"
GEONATURE_API_TAXHUB: "http://127.0.0.1:5000/api"
GEONATURE_URL_APPLICATION: "http://127.0.0.1:4200"
-
name: Archive GeoNature frontend configuration
uses: actions/upload-artifact@v3
with:
name: frontend-config-geonature
path: frontend/src/conf/app.config.ts
-
name: Archive OccTax frontend configuration
uses: actions/upload-artifact@v3
with:
name: frontend-config-occtax
path: contrib/occtax/frontend/app/module.config.ts
-
name: Archive OccHab frontend configuration
uses: actions/upload-artifact@v3
with:
name: frontend-config-occhab
path: contrib/gn_module_occhab/frontend/app/module.config.ts
-
name: Archive Validation frontend config
uses: actions/upload-artifact@v3
with:
name: frontend-config-validation
path: contrib/gn_module_validation/frontend/app/module.config.ts

build-frontend:
name: Build frontend image
runs-on: ubuntu-latest
needs: frontend-config
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
submodules: True
-
name: Download GeoNature frontend configuartion
uses: actions/download-artifact@v3
with:
name: frontend-config-geonature
path: frontend/src/conf/
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Download OccTax frontend configuartion
uses: actions/download-artifact@v3
name: Login to GHCR
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
with:
name: frontend-config-occtax
path: contrib/occtax/frontend/app/
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Download OccHab frontend configuartion
uses: actions/download-artifact@v3
name: Generate metadata for source image
id: meta-source
uses: docker/metadata-action@v4
with:
name: frontend-config-occhab
path: contrib/gn_module_occhab/frontend/app/
images: ghcr.io/${{ github.repository_owner }}/geonature-frontend
flavor: |
suffix=-source
tags: |
type=ref,event=branch
type=ref,event=tag
-
name: Download Validation frontend configuartion
uses: actions/download-artifact@v3
name: Build and export source image
uses: docker/build-push-action@v4
with:
name: frontend-config-validation
path: contrib/gn_module_validation/frontend/app/
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
context: .
file: ./frontend/Dockerfile
target: source
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-source.outputs.tags }}
labels: ${{ steps.meta-source.outputs.labels }}
-
name: Docker meta
id: meta
name: Generate metadata for nginx image
id: meta-nginx
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/geonature-frontend
flavor: |
suffix=-nginx
tags: |
type=ref,event=branch
type=ref,event=tag
-
name: Login to GHCR
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
name: Build and export nginx image
uses: docker/build-push-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
context: .
file: ./frontend/Dockerfile
target: prod-base
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-nginx.outputs.tags }}
labels: ${{ steps.meta-nginx.outputs.labels }}
-
name: Generate metadata for prod image
id: meta-prod
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/geonature-frontend
tags: |
type=ref,event=branch
type=ref,event=tag
-
name: Build and export
uses: docker/build-push-action@v3
name: Build and export prod image
uses: docker/build-push-action@v4
with:
context: .
file: ./frontend/Dockerfile
target: prod-full
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: prod
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-prod.outputs.tags }}
labels: ${{ steps.meta-prod.outputs.labels }}
15 changes: 9 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@ jobs:
backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Backend code formatting check (Black)
uses: psf/black@stable

frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Frontend code formatting check (Prettier)
uses: creyD/[email protected]
- uses: actions/checkout@v3
with:
dry: True
prettier_options: --config frontend/.prettierrc --check frontend/src/app/**/*.ts
fetch-depth: 0
- uses: actions/setup-node@v3
- name: Frontend code formatting check (Prettier)
run: npm install prettier && npm run format:check
working-directory: ./frontend
Loading

0 comments on commit 2e6c5e0

Please sign in to comment.