Skip to content

Update docker secret keys management #772

Update docker secret keys management

Update docker secret keys management #772

Workflow file for this run

name: Tests
on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
jobs:
build:
runs-on: ubuntu-latest
services:
db:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pipenv
sudo apt-get install -y gettext
cd back
pipenv install --dev --system
- name: Run migrations
run: |
mv .example_env back/back/.env
cd back
python manage.py migrate
- name: Test with pytest
run: |
cd back
django-admin compilemessages
pytest --cov=. --cov-report=xml
- name: Upload to coveralls
run: |
cd back
python -m pip install coveralls
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check formatting/linting ruff and black
run: |
cd back
ruff check . && ruff format . --check
- name: Check migrations
run: |
cd back
python manage.py makemigrations --check
- name: Test fixtures
run: |
cd back
python manage.py shell < fixtures/init_testing.py
python manage.py loaddata all.json
python manage.py loaddata welcome_message.json
# credits: https://hacksoft.io/github-actions-in-action-setting-up-django-and-postgres/