-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from TelesCoop/fix-ci
Enable CI
- Loading branch information
Showing
18 changed files
with
24,670 additions
and
205,976 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,17 @@ name: Run basic checks | |
on: | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
pull_request: | ||
branches: [main, dev] | ||
types: # https://github.com/mistralai/mistral-common/blob/main/.github/workflows/lint_build_test.yaml | ||
branches: | ||
- dev | ||
- main | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
# Run CI only when PR is ready for review or when commits are added | ||
|
||
env: | ||
TELESCOOP_DEV: true | ||
IS_TESTING: true | ||
|
@@ -20,63 +22,83 @@ jobs: | |
setup: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install python | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" | ||
# https://github.com/actions/setup-python/blob/main/README.md#caching-packages-dependencies | ||
- run: pip install -r back/requirements.txt | ||
|
||
- name: Install front js dependencies | ||
run: npm install | ||
working-directory: ./front | ||
- name: Create back/local_settings.conf | ||
run: echo "${{ secrets.LOCAL_SETTINGS_CONF }}" > local_settings.conf | ||
working-directory: ./back | ||
- name: Cache Python dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('back/requirements.txt') }} | ||
|
||
- name: Cache Node.js dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./front/node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('front/package-lock.json') }} | ||
|
||
pre-commit: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-22.04 | ||
needs: setup | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" | ||
- name: Restore Python cache | ||
uses: actions/cache@v3 | ||
# https://github.com/actions/setup-python/blob/main/README.md#caching-packages-dependencies | ||
- run: pip install -r back/requirements.txt | ||
|
||
- name: Set up PostGIS | ||
uses: nyurik/action-setup-postgis@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('back/requirements.txt') }} | ||
- name: Install python dependencies if not cached | ||
if: steps.cache-python.outputs.cache-hit != 'true' | ||
run: pip install -r back/requirements.txt | ||
username: myuser | ||
password: securepassword | ||
database: mydatabase | ||
port: 5432 | ||
id: postgres | ||
|
||
- name: Create local_setting.ini | ||
run: | | ||
cat <<EOF > back/local_settings.ini | ||
[database] | ||
engine=postgresql | ||
user=myuser | ||
name=mydatabase | ||
password=securepassword | ||
EOF | ||
- name: Restore Node.js cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./front/node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('front/package-lock.json') }} | ||
|
||
- name: Install js dependencies if not cached | ||
if: steps.cache-node.outputs.cache-hit != 'true' | ||
run: npm install | ||
working-directory: ./front | ||
|
||
- name: Enforce pre-commit hook server side | ||
env: | ||
DATABASE_URL: "postgres://myuser:securepassword@localhost:5432/mydatabase" | ||
PGSERVICE: ${{ steps.postgres.outputs.service-name }} | ||
uses: pre-commit/[email protected] | ||
|
||
node-setup: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-22.04 | ||
needs: setup | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -96,7 +118,7 @@ jobs: | |
working-directory: ./front | ||
|
||
frontend-tests: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-22.04 | ||
needs: [setup, node-setup] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -117,15 +139,24 @@ jobs: | |
- name: Run vitest | ||
run: npm run test | ||
working-directory: ./front | ||
- name: Run cypress component tests | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
component: true | ||
working-directory: ./front | ||
|
||
# - name: Run cypress component tests | ||
# uses: cypress-io/github-action@v6 | ||
# with: | ||
# component: true | ||
# working-directory: ./front | ||
doc-tests: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-22.04 | ||
needs: [setup] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python doc | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" | ||
- run: pip install mkdocs mkdocs-material mkdocstrings[python] mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin pymdown-extensions | ||
|
||
- name: Run documentation validation | ||
run: mkdocs build |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,5 @@ mvt_files/* | |
media/* | ||
back/site/* | ||
site/* | ||
|
||
back/.coverage |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
fileignoreconfig: | ||
- filename: back/iarbre_data/tests/test_data/parkingsurfacique.geojson | ||
checksum: 66a6bee103123c599470c847555001aff5d7db6e7571e5904160f88b6d4ad0c0 | ||
- filename: back/iarbre_data/tests/test_data/espacepublic.geojson | ||
checksum: 923eba4992fca9f4d232e3ecec353c4698f91f7a1578a51c81a0b1d01d32210b | ||
- filename: back/iarbre_data/tests/test_data/communes_gl_2025.geojson | ||
checksum: be406c3274b27238f1d5497edb83f0b4331ad92cab8d28bc77e151202663b9d0 | ||
version: "" |
Oops, something went wrong.