-
Notifications
You must be signed in to change notification settings - Fork 3
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 #469 from ropable/master
Version 1.0 release
- Loading branch information
Showing
865 changed files
with
23,570 additions
and
162,498 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
[flake8] | ||
ignore = E231,E265,E501,E722,W503 |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,46 @@ | ||
name: "Build docs pages" | ||
on: | ||
push: | ||
branches: [master] | ||
tags: ['*'] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
build-docs: | ||
name: Build docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
- name: Load cached venv | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install project | ||
run: poetry install --no-interaction | ||
- name: Build documentation | ||
run: | | ||
mkdir gh-pages | ||
touch gh-pages/.nojekyll | ||
poetry run sphinx-build -b html docs _build | ||
cp -r _build/* gh-pages/ | ||
- name: Deploy documentation | ||
if: ${{ github.event_name == 'push' }} | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: gh-pages |
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,65 @@ | ||
name: "Build Docker image and run vulnerability scan" | ||
|
||
on: | ||
push: | ||
# Publish `master` as `latest` image. | ||
branches: [master] | ||
# Publish `v0.*` tags as releases. | ||
tags: ['v0.*'] | ||
pull_request: | ||
branches: [master] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
name: Build Docker image and run vulnerability scan | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
security-events: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
id: checkout-repo | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Log into registry ${{ env.REGISTRY }} | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
flavor: | | ||
latest=true | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
- name: Run Trivy vuln scanner on Docker image | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' | ||
format: 'sarif' | ||
output: 'trivy-results.sarif' | ||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: 'trivy-results.sarif' |
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,66 @@ | ||
name: "Run unit tests" | ||
|
||
on: | ||
# Triggers the workflow on push or pull request events but only for the master branch | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run_tests: | ||
name: Run Django Tests | ||
runs-on: ubuntu-latest | ||
env: | ||
DATABASE_URL: postgis://postgres:postgres@localhost:5432/postgres | ||
services: | ||
postgres: | ||
image: postgis/postgis:13-3.1-alpine | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
ports: | ||
- 5432:5432 | ||
options: --mount type=tmpfs,destination=/var/lib/postgresql/data --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
id: checkout-repo | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
id: setup-python | ||
with: | ||
python-version: '3.10' | ||
- name: Install GDAL | ||
id: install-gdal | ||
run: | | ||
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable | ||
sudo apt-get update | ||
sudo apt-get install gdal-bin libgdal-dev | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install cached dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
- name: Install project | ||
run: poetry install --no-interaction | ||
- name: Run DB migrations | ||
run: | | ||
source .venv/bin/activate | ||
python manage.py migrate | ||
- name: Run tests | ||
run: | | ||
source .venv/bin/activate | ||
python manage.py collectstatic | ||
python manage.py test --noinput --failfast -v2 |
Oops, something went wrong.