Skip to content

Commit

Permalink
Merge pull request #12 from 2jun0/GDET-25
Browse files Browse the repository at this point in the history
GDET-25: 자동 테스트 구축
  • Loading branch information
2jun0 authored Jan 11, 2024
2 parents 251a332 + 7a27fc4 commit 986344f
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 4 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/test-backend-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test backend app

on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
env:
working-directory: ./backend

steps:
- uses: actions/checkout@v3

- name: setup python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.6.1

- name: setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ${{env.working-directory}}/.venv
key: venv-${{ hashFiles('poetry.lock') }}

- name: install the project dependencies
run: poetry install
working-directory: ${{env.working-directory}}

- name: test app
run: poetry run python -m pytest tests -c pytest.ini
working-directory: ${{env.working-directory}}
8 changes: 4 additions & 4 deletions backend/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pytest-dotenv = "^0.5.2"
faker = "^21.0.0"
httpx = "^0.26.0"
aiosqlite = "^0.19.0"
pytest = "^7.4.4"

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit 986344f

Please sign in to comment.