From 865e3bdf56a6ab499d1ba8e54b896f39116fe872 Mon Sep 17 00:00:00 2001 From: Manabu Niseki Date: Sun, 17 Mar 2024 14:00:05 +0900 Subject: [PATCH] refactor: simpify CI --- .github/workflows/test.yml | 4 +--- backend/main.py | 9 +++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 75b963c..8246826 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,9 +22,7 @@ jobs: - name: Install dependencies run: poetry install - name: Run tests - run: | - mkdir -p frontend/dist/assets - poetry run pytest --cov=app + run: poetry run pytest --cov=app - name: Coveralls env: COVERALLS_PARALLEL: true diff --git a/backend/main.py b/backend/main.py index 2dcbdd7..4d8c0f3 100644 --- a/backend/main.py +++ b/backend/main.py @@ -21,8 +21,13 @@ def create_app(): # add routes app.include_router(api_router, prefix="/api") - app.mount("/assets", StaticFiles(directory="frontend/dist/assets"), name="assets") - app.mount("/", StaticFiles(html=True, directory="frontend/dist/"), name="index") + try: + app.mount( + "/assets", StaticFiles(directory="frontend/dist/assets"), name="assets" + ) + app.mount("/", StaticFiles(html=True, directory="frontend/dist/"), name="index") + except Exception: + pass return app