Skip to content

Commit

Permalink
Add pytest & GitHub actions yaml (#1)
Browse files Browse the repository at this point in the history
* Add pytest & actions.yaml

* Fix

* Fix #2

* Fix #3

* Fix #4

* Fix #5

* Fix #6
  • Loading branch information
m-danya authored Mar 31, 2024
1 parent 18f27f7 commit 98db3e1
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
push
name: pytest
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up .env
run: cp .env.sample .env

- name: Build and run containers
run: DOCKER_BUILDKIT=1 docker-compose up -d backend

- name: Check running containers
run: docker-compose ps -a

- name: Test with pytest
run: docker-compose exec -T backend pytest 2>&1 > pytest_log.txt

- name: Show pytest output
run: cat pytest_log.txt
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ the system at `${DEPLOYMENT_HOST}:${DOCKER_FRONTEND_PORT}`.
- Autoplay for karaoke mode (reuse AudioComponent?)
- Fix admin panel being available only at ${FASTAPI_PORT} but not at ${NGINX_PORT}
- Tune Genius search query (e.g. remove the parentheses in track title)
- Add authentication with JWT for admin panel
- Skip banned tracks from album
- Show tracks collection with filters
- Replace Font Awesome Icons with smth less bloated
Expand Down
2 changes: 2 additions & 0 deletions accompanist/tests/test_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_example():
print("Hello from pytest inside Docker inside GitHub Actions runtime!")
84 changes: 83 additions & 1 deletion poetry.lock

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

5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ demucs = "^4.0.1"
lyricsgenius = "^3.0.1"
flower = "^2.0.1"
sqladmin = "^0.16.1"
pytest = "^8.1.1"
pytest-asyncio = "^0.23.6"

[tool.poetry.group.dev.dependencies]
ruff = "^0.3.2"
Expand All @@ -31,3 +33,6 @@ build-backend = "poetry.core.masonry.api"

[tool.ruff]
extend-select = ["I"]

[tool.pytest.ini_options]
asyncio_mode = "auto"

0 comments on commit 98db3e1

Please sign in to comment.