From 02e86bd07974eb99439b59100aa1509a8ef9837a Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Fri, 16 Aug 2024 00:22:05 -0400 Subject: [PATCH] CI: Build Vite assets for test workflow --- .gitea/workflows/test.yml | 10 ++++++++++ cmsmanage/settings.py | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 24dba43..67f7a83 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -36,5 +36,15 @@ jobs: sudo apt-get -y install build-essential python3-dev libldap2-dev libsasl2-dev mariadb-client - name: Install python dependencies run: pdm sync -d -G dev + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: latest + run_install: | + - args: [--frozen-lockfile, --strict-peer-dependencies] + - name: Build JS assets + run: pnpm run build + - name: Run tests run: pdm run -v ./manage.py test diff --git a/cmsmanage/settings.py b/cmsmanage/settings.py index fd1818c..4924b5b 100644 --- a/cmsmanage/settings.py +++ b/cmsmanage/settings.py @@ -357,6 +357,12 @@ class CI(Base): configure_hypothesis_profiles() settings.load_profile("ci") + @property + def DJANGO_VITE(self): + d = super().DJANGO_VITE + d["default"]["manifest_path"] = BASE_DIR / "vite-dist" / "manifest.json" + return d + SECRET_KEY = "aed7jee2kai1we9eithae0gaegh9ohthoh4phahk5bau4Ahxaijo3aicheex3qua" DATABASES = {