Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#228 tests in actions #251

Merged
merged 4 commits into from
Oct 4, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Testing BE
on: pull_request

env:
SECRET_KEY: django-insecure-8p_=_(i8$#=t_n26md(d7=gpc%5sss!4-1a0cp(lir3-0x^$8%
PG_DB: db
PG_USER: postgres
PG_PASSWORD: postgres
DB_HOST: 127.0.0.1
DB_PORT: 5432
EMAIL_BACKEND: django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST: smtp.gmail.com
EMAIL_PORT: 587
EMAIL_USE_TLS: 1
EMAIL_HOST_USER: [email protected]
EMAIL_HOST_PASSWORD: evezhjqcfubkudrg
CORS_ORIGIN_WHITELIST: ''
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Credentials should be hidden. Read about GitHub secrets.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for feedback. Done.


jobs:
build:
name: Testing
runs-on: ubuntu-latest
services:
# Label used to access the service container ?
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_USER: postgres
POSTGRES_DB: db
POSTGRES_PASSWORD: postgres
# # Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
with:
python-verion: 3.10
- name: install requirements.txt
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Create Migrations
run: |
python manage.py makemigrations
python manage.py migrate
- name: running tests
run: python manage.py test
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new empty line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried, but git deleted it again

Loading