test: test both userscript and extension builds

This commit is contained in:
xenticore
2025-05-01 15:38:51 -04:00
parent 95ce637892
commit 8d8dea0bdc
5 changed files with 11 additions and 5 deletions

View File

@@ -23,8 +23,10 @@ jobs:
id: version id: version
- name: Install dependencies - name: Install dependencies
run: bun install run: bun install
- name: Test project - name: Test UserScript version
run: bun test --define __VERSION__='${{ steps.version.outputs.version }}' --define __EXTENSION_NAME='"tf2wikipricing"' run: bun test --define __VERSION__='${{ steps.version.outputs.version }}' --define __EXTENSION_NAME='"tf2wikipricing"' --define __ENV_USERSCRIPT=1 --define __ENV_WEBEXTENSION=0
- name: Test WebExtension version
run: bun test --define __VERSION__='${{ steps.version.outputs.version }}' --define __EXTENSION_NAME='"tf2wikipricing"' --define __ENV_USERSCRIPT=0 --define __ENV_WEBEXTENSION=1
- name: Build project - name: Build project
run: bun run build run: bun run build
- name: Archive production artifacts - name: Archive production artifacts

View File

@@ -19,8 +19,10 @@ jobs:
id: version id: version
- name: Install dependencies - name: Install dependencies
run: bun install run: bun install
- name: Test project - name: Test UserScript version
run: bun test --define __VERSION__='${{ steps.version.outputs.version }}' --define __EXTENSION_NAME='"tf2wikipricing"' run: bun test --define __VERSION__='${{ steps.version.outputs.version }}' --define __EXTENSION_NAME='"tf2wikipricing"' --define __ENV_USERSCRIPT=1 --define __ENV_WEBEXTENSION=0
- name: Test WebExtension version
run: bun test --define __VERSION__='${{ steps.version.outputs.version }}' --define __EXTENSION_NAME='"tf2wikipricing"' --define __ENV_USERSCRIPT=0 --define __ENV_WEBEXTENSION=1
- name: Build project - name: Build project
run: bun run build --mode production run: bun run build --mode production
- name: Archive production artifacts - name: Archive production artifacts

BIN
bun.lockb

Binary file not shown.

View File

@@ -1,3 +1,4 @@
import { GlobalRegistrator } from "@happy-dom/global-registrator"; import { GlobalRegistrator } from "@happy-dom/global-registrator";
GlobalRegistrator.register(); GlobalRegistrator.register();
Object.assign(global, require('jest-chrome'))

View File

@@ -46,6 +46,7 @@
"css-loader": "^7.1.2", "css-loader": "^7.1.2",
"css-to-string-loader": "^0.1.3", "css-to-string-loader": "^0.1.3",
"extract-loader": "^5.1.0", "extract-loader": "^5.1.0",
"jest-chrome": "^0.8.0",
"jsonc-loader": "^0.1.1", "jsonc-loader": "^0.1.1",
"mini-css-extract-plugin": "^2.9.2", "mini-css-extract-plugin": "^2.9.2",
"postcss-loader": "^8.1.1", "postcss-loader": "^8.1.1",