Skip to content

Commit

Permalink
new integration test pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
KoalaSat committed Sep 18, 2024
1 parent 36472ea commit d14c3a6
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 29 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/frontend-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 16 additions & 14 deletions frontend/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
3 changes: 2 additions & 1 deletion tests/test_frontend_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ def test_basic_frontend_url_content(self):
response = self.client.get(path)
self.assertContains(response, "<html>")
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, "<html>")
self.assertContains(response, "RoboSats PRO -")
self.assertContains(response, "static/frontend/main.v")

0 comments on commit d14c3a6

Please sign in to comment.