Skip to content

Commit

Permalink
Merge pull request #469 from ropable/master
Browse files Browse the repository at this point in the history
Version 1.0 release
  • Loading branch information
ropable authored Jul 28, 2023
2 parents 92f92ca + ab2e9b8 commit f28cd6c
Show file tree
Hide file tree
Showing 865 changed files with 23,570 additions and 162,498 deletions.
27 changes: 0 additions & 27 deletions .coveragerc

This file was deleted.

18 changes: 0 additions & 18 deletions .dockerignore

This file was deleted.

29 changes: 0 additions & 29 deletions .editorconfig

This file was deleted.

2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
ignore = E231,E265,E501,E722,W503
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 14 * * 3'

jobs:
analyse:
Expand Down
54 changes: 0 additions & 54 deletions .github/workflows/django.yml

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/docker.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/docs_pages.yml
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
65 changes: 65 additions & 0 deletions .github/workflows/image-build-scan.yml
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'
66 changes: 66 additions & 0 deletions .github/workflows/run-tests.yml
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
Loading

0 comments on commit f28cd6c

Please sign in to comment.