Skip to content

github actions fixed #5

github actions fixed

github actions fixed #5

Workflow file for this run

---
name: checks
on: [push]
jobs:
test:
name: unit tests
runs-on: ubuntu-20.04
services:
db:
image: postgres:15-alpine
env:
POSTGRES_DB: ${{ secrets.DB_NAME }}
POSTGRES_USER: ${{ secrets.DB_USER }}
POSTGRES_PASSWORD: ${{ secrets.DB_PASSWORD }}
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
steps:
- name: Login with actions
uses: docker/login-action@v1
with:
username: ${{secrets.DOCKERHUB_USER}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: check out
uses: actions/checkout@v2
- name: Set up project secrets
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_NAME: ${{ secrets.DB_NAME }}
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
run: |
echo "SECRET_KEY=${SECRET_KEY}" >> $GITHUB_ENV
echo "DB_USER=${DB_USER}" >> $GITHUB_ENV
echo "DB_PASSWORD=${DB_PASSWORD}" >> $GITHUB_ENV
echo "DB_NAME=${DB_NAME}" >> $GITHUB_ENV
echo "DB_HOST=${DB_HOST}" >> $GITHUB_ENV
echo "DB_PORT=${DB_PORT}" >> $GITHUB_ENV
- name: Test
run: docker compose run --rm gap sh -c "python3 manage.py test"