-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
333 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: test | ||
|
||
on: push | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
# strategy: | ||
# matrix: | ||
# python-version: ["3.11"] | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_DB: db_test | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_PORT: 5432 | ||
# set health checks to wait until postgres has started | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- name: Checkout project code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
# python-version: ${{ matrix.python-version }} | ||
python-version: 3.11.9 | ||
|
||
- name: Install pipenv | ||
run: | | ||
python -m pip install --upgrade pipenv wheel | ||
- id: chache-pipenv | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.local/share/virtualenvs/ | ||
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.chache-pipenv.outputs.cache-hit != 'true' | ||
run: | | ||
python -m pipenv install --dev && pip install -r requirements/base.txt | ||
- name: Apply DB migrations | ||
run: | | ||
pipenv run python manage.py migrate | ||
- name: Run tests | ||
run: | | ||
pipenv run pytest -v |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
DJANGO_SETTINGS_MODULE=core.settings | ||
DB_NAME=db_test | ||
DB_USER=postgres | ||
DB_PASSWORD=postgres | ||
DB_HOST=db | ||
DB_PORT=5432 | ||
POSTGRES_PASSWORD=postgres | ||
REDIS_HOST=broker | ||
REDIS_PORT=6379 |
Oops, something went wrong.