diff --git a/.github/workflows/frontend-build.yml b/.github/workflows/frontend-build.yml index d8312180..625e6fc4 100644 --- a/.github/workflows/frontend-build.yml +++ b/.github/workflows/frontend-build.yml @@ -50,20 +50,27 @@ jobs: export NODE_OPTIONS="--max-old-space-size=4096" cd frontend npm run build - - name: 'Archive Web Basic Build Results' + - name: 'Archive Web Static Build Results' uses: actions/upload-artifact@v4 with: - name: web-main-js + name: web-main-static path: | - frontend/static/frontend/*main.js - frontend/static/frontend/*.wasm - - name: 'Archive Web PRO Build Results' + frontend/static + frontend/templates/frontend/*.html + - name: 'Archive Node App Static Build Results' uses: actions/upload-artifact@v4 with: - name: web-pro-js + name: nodeapp-main-static path: | - frontend/static/frontend/*pro.js - frontend/static/frontend/*.wasm + nodeapp/static + nodeapp/*.html + - name: 'Archive Desktop App Static Build Results' + uses: actions/upload-artifact@v4 + with: + name: desktop-main-static + path: | + desktopApp/static + desktopApp/*.html - name: 'Archive Mobile Build Results' uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 0d795af6..7233836e 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -30,6 +30,14 @@ jobs: - name: 'Checkout' uses: actions/checkout@v4 + - name: 'Download static files Artifact' + uses: dawidd6/action-download-artifact@v6 + with: + workflow: frontend-build.yml + workflow_conclusion: success + name: web-main-static + path: frontend + - name: Patch Dockerfile and .env-sample run: | sed -i "1s/FROM python:.*/FROM python:${{ matrix.python-tag }}/" Dockerfile diff --git a/.gitignore b/.gitignore index acdeb8dd..c65f02cf 100755 --- a/.gitignore +++ b/.gitignore @@ -648,16 +648,15 @@ docs/_site* node # frontend statics +frontend/templates/frontend/*.html mobile/html/Web.bundle/static/* -mobile/html/Web.bundle/index.html +mobile/html/Web.bundle/*.html desktopApp/static/* -desktopApp/index.html +desktopApp/*.html web/static/* -web/basic.html -web/pro.html +web/*.html nodeapp/static/* -nodeapp/basic.html -nodeapp/pro.html +nodeapp/*.html # Protocol Buffers api/lightning/*.proto diff --git a/frontend/webpack.config.ts b/frontend/webpack.config.ts index 47700f76..3bcdd33d 100644 --- a/frontend/webpack.config.ts +++ b/frontend/webpack.config.ts @@ -84,21 +84,23 @@ const configNode: Configuration = { robosatsSettings: 'desktop-basic', }), // Web App HTML - new CopyPlugin({ - patterns: [ - { - from: path.resolve(__dirname, 'templates/frontend/basic.html'), - to: path.resolve(__dirname, '../web/basic.html'), - }, - ], + new HtmlWebpackPlugin({ + template: path.resolve(__dirname, 'templates/frontend/index.ejs'), + templateParameters: { + pro: false, + }, + filename: path.resolve(__dirname, '../web/basic.html'), + inject: 'body', + robosatsSettings: 'web-basic', }), - new CopyPlugin({ - patterns: [ - { - from: path.resolve(__dirname, 'templates/frontend/pro.html'), - to: path.resolve(__dirname, '../web/pro.html'), - }, - ], + new HtmlWebpackPlugin({ + template: path.resolve(__dirname, 'templates/frontend/index.ejs'), + templateParameters: { + pro: true, + }, + filename: path.resolve(__dirname, '../web/pro.html'), + inject: 'body', + robosatsSettings: 'web-pro', }), // Static files new CopyPlugin({ diff --git a/tests/test_frontend_fetch.py b/tests/test_frontend_fetch.py index 232c9c19..08b68b2d 100644 --- a/tests/test_frontend_fetch.py +++ b/tests/test_frontend_fetch.py @@ -11,9 +11,10 @@ class FrontendFetchTest(TestCase): response = self.client.get(path) self.assertContains(response, "") self.assertContains(response, "RoboSats -") + self.assertContains(response, "static/frontend/main.v") def test_pro_frontend_url_content(self): path = reverse("pro") response = self.client.get(path) self.assertContains(response, "") - self.assertContains(response, "RoboSats PRO -") + self.assertContains(response, "static/frontend/main.v")