[8471] apps/contrib/templates: add template file for alerts #6843
Workflow file for this run
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
name: Django CI | |
on: | |
push: | |
branches: [ main, dev ] | |
pull_request: | |
branches: [ main, dev ] | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
services: | |
postgres: | |
image: postgres:16 | |
env: | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
redis: | |
image: redis | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: Setup Postgres | |
env: | |
PGPASSWORD: postgres | |
PGHOSTADDR: 127.0.0.1 | |
run: | | |
psql -c 'create database django;' -U postgres | |
psql -c 'create database django_test;' -U postgres | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Cache pip packages | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-pip-packages | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/requirements/dev.txt') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Check a4 hashes equal | |
run: | | |
./scripts/a4-check.sh | |
- name: Install Dependencies | |
run: | | |
npm install | |
npm run build | |
pip install -r requirements/dev.txt | |
pip install coveralls | |
- name: Run Tests | |
env: | |
PGPASSWORD: postgres | |
PGHOSTADDR: 127.0.0.1 | |
run: | | |
python manage.py collectstatic > /dev/null | |
mkdir -p media | |
DJANGO_SETTINGS_MODULE='meinberlin.config.settings.travis' py.test --cov | |
isort --diff -c meinberlin tests | |
python manage.py makemigrations --dry-run --check --noinput | |
flake8 meinberlin tests --exclude migrations,settings | |
- name: Coveralls | |
env: | |
GITHUB_TOKEN: ${{ secrets.COV }} | |
run: | | |
coveralls | |
- name: Run Frontend Tests | |
run: | | |
npm test | |
npm run lint | |
- name: Deploy dev | |
if: github.ref == 'refs/heads/dev' | |
env: | |
TRAVIS_SSH_SECRET: ${{ secrets.DEPLOY }} | |
PROJECT_BUILD: 'meinberlin-design' | |
VERSION_BUILD: 'dev' | |
run: | | |
./scripts/deploy.sh $PROJECT_BUILD ${VERSION_BUILD##*/} | |
- name: Deploy main | |
if: github.ref == 'refs/heads/main' | |
env: | |
TRAVIS_SSH_SECRET: ${{ secrets.DEPLOY }} | |
run: | | |
./scripts/deploy.sh |