Skip to content

Commit

Permalink
upload test result
Browse files Browse the repository at this point in the history
  • Loading branch information
BrittleFoot committed Jan 28, 2024
1 parent 3cfb20a commit 82d2d57
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 5 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,20 @@ jobs:

- name: Lint
id: lint
run: make lint
run: make lint ARGS=--output-format=github

- name: Run tests
id: test
env:
DATABASE_URL: postgres://postgres:@localhost:5432/postgres
run: make test
run: make test ARGS="--doctest-modules --junitxml=junit/test-results.xml"

- name: Upload pytest results
uses: actions/upload-artifact@v4
with:
name: pytest-results
path: junit/test-results.xml
if: ${{ always() }}

docker:
needs: build
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,5 @@ pyrightconfig.json

.vscode/
.piterpy/

junit
src/static/
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ deps:
pip-sync requirements.txt dev-requirements.txt

lint:
ruff src
ruff src $(ARGS)

fix:
ruff src --fix

test:
pytest
pytest src $(ARGS)

start:
docker-compose up -d
cd src && ./manage.py runserver

# image:
# docker build -t test .
1 change: 1 addition & 0 deletions dev-requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ruff

pytest
pytest-cov
pytest-django
mixer
7 changes: 7 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#
# pip-compile dev-requirements.in
#
coverage[toml]==7.4.1
# via
# coverage
# pytest-cov
faker==12.0.1
# via mixer
iniconfig==2.0.0
Expand All @@ -17,7 +21,10 @@ pluggy==1.4.0
pytest==7.4.4
# via
# -r dev-requirements.in
# pytest-cov
# pytest-django
pytest-cov==4.1.0
# via -r dev-requirements.in
pytest-django==4.7.0
# via -r dev-requirements.in
python-dateutil==2.8.2
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ services:
environment:
- POSTGRES_HOST_AUTH_METHOD=trust

# Test local run in docker
# build app image with `make image` (also commented) beforehand

# backend:
# image: test
# command: wait-for-it postgres:5432 -- /bin/sh -c "./manage.py migrate && uwsgi --master --http :8000 --module app.wsgi"
Expand Down

0 comments on commit 82d2d57

Please sign in to comment.