-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add quality checks CI jobs * add jobs in package.json * add test CI jobs
- Loading branch information
Showing
6 changed files
with
290 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" | ||
|
||
- package-ecosystem: "pip" | ||
directory: "backend/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" | ||
ignore: | ||
- dependency-name: "django" | ||
update-types: [ "version-update:semver-major", "version-update:semver-minor" ] # only allow auto update on django bug and security fixes | ||
|
||
- package-ecosystem: "npm" | ||
directory: "front-end/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
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,22 @@ | ||
changelog: | ||
categories: | ||
- title: 🎉 Features | ||
labels: | ||
- '*' | ||
exclude: | ||
labels: | ||
- dependencies | ||
- Bug | ||
- documentation | ||
|
||
- title: 🛠 Bug fixes | ||
labels: | ||
- 'Bug' | ||
|
||
- title: 📘 Documentation | ||
labels: | ||
- documentation | ||
|
||
- title: ⤴ Dependencies | ||
labels: | ||
- dependencies |
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,116 @@ | ||
name: Quality checks | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- next | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
|
||
jobs: | ||
flake8: | ||
name: Python Flake8 check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: ./backend/.python-version | ||
|
||
- name: Install flake8 | ||
working-directory: ./backend | ||
run: | | ||
pip install flake8 -c dev-requirements.txt | ||
- name: Flake8 | ||
working-directory: ./backend | ||
run: | | ||
flake8 project | ||
isort: | ||
name: Python iSort check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: ./backend/.python-version | ||
|
||
- name: Install isort | ||
working-directory: ./backend | ||
run: | | ||
pip install isort -c dev-requirements.txt | ||
- name: iSort | ||
working-directory: ./backend | ||
run: | | ||
isort -c project | ||
black: | ||
name: Python Black check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: ./backend/.python-version | ||
|
||
- name: Install black | ||
working-directory: ./backend | ||
run: | | ||
pip install black -c dev-requirements.txt | ||
- name: black | ||
working-directory: ./backend | ||
run: | | ||
black --check project | ||
prettier: | ||
name: JS Prettier check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ./front-end/.nvmrc | ||
cache: 'npm' | ||
cache-dependency-path: ./front-end/.nvmrc | ||
|
||
- name: Install node dependencies | ||
working-directory: ./front-end | ||
run: | | ||
npm ci --no-audit | ||
- name: Prettier check | ||
working-directory: ./front-end | ||
run: | | ||
npm run format:check | ||
type: | ||
name: JS Type check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ./front-end/.nvmrc | ||
cache: 'npm' | ||
cache-dependency-path: ./front-end/.nvmrc | ||
|
||
- name: Install node dependencies | ||
working-directory: ./front-end | ||
run: | | ||
npm ci --no-audit | ||
- name: Type check | ||
working-directory: ./front-end | ||
run: | | ||
npm run type:check |
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,124 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- next | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
CI: false | ||
|
||
jobs: | ||
python-unittests: | ||
name: Python Unit tests | ||
runs-on: ubuntu-latest | ||
env: | ||
POSTGRES_DB: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_USER: postgres | ||
POSTGRES_HOST: 127.0.0.1 | ||
|
||
services: | ||
postgres: | ||
image: postgis/postgis:16-3.4 | ||
env: | ||
POSTGRES_DB: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_USER: postgres | ||
ports: | ||
- 5432:5432 | ||
# Set health checks to wait until postgres has started | ||
options: >- | ||
--health-cmd pg_isready | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: ./backend/.python-version | ||
cache: 'pip' | ||
cache-dependency-path: | | ||
./backend/requirements.txt | ||
./backend/dev-requirements.txt | ||
- name: Install system libraries | ||
working-directory: ./backend | ||
run: | | ||
sudo apt-get -qq update | ||
sudo apt-get -qq install -y libpq-dev gdal-bin gettext | ||
- name: Install dependencies | ||
working-directory: ./backend | ||
run: | | ||
pip install -r requirements.txt -r dev-requirements.txt | ||
- name: Run django unit tests | ||
working-directory: ./backend | ||
run: | | ||
coverage run --parallel-mode --concurrency=multiprocessing ./manage.py test --parallel -v 3 | ||
coverage combine | ||
coverage xml -o coverage.xml | ||
- uses: codecov/codecov-action@v4 | ||
with: | ||
files: ./backend/coverage.xml | ||
flags: python-unittests | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
js-build: | ||
name: JS tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ./front-end/.nvmrc | ||
cache: 'npm' | ||
cache-dependency-path: ./front-end/.nvmrc | ||
|
||
- name: Install node dependencies | ||
working-directory: ./front-end | ||
run: | | ||
npm ci --no-audit | ||
- name: npm build | ||
working-directory: ./front-end | ||
run: | | ||
npm run build | ||
docker-build: | ||
name: Docker build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: .docker/Dockerfile | ||
push: false | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
target: prod | ||
|
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 @@ | ||
20 |
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