fix: ci crash due to no dugite binary, due to NODE_ENV=test not set

This commit is contained in:
lin onetwo 2025-06-13 00:35:35 +08:00
parent 18731a5f25
commit bc32d6fecb
3 changed files with 7 additions and 6 deletions

View file

@ -20,7 +20,7 @@ on:
jobs:
test:
runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
@ -83,7 +83,7 @@ jobs:
with:
name: application-logs
path: |
~/Library/Logs/TidGi/
~/.local/share/TidGi/
userData-dev/logs/
retention-days: 7
continue-on-error: true

View file

@ -105,7 +105,9 @@ When('I launch the TidGi application', async function(this: ApplicationWorld) {
const windowTimeout = process.env.CI ? 45000 : 10000;
this.mainWindow = await this.app.firstWindow({ timeout: windowTimeout });
} catch (error) {
throw new Error(`Failed to launch TidGi application: ${error as Error}. You should run \`pnpm run package:dev\` before running the tests to ensure the app is built.`);
throw new Error(
`Failed to launch TidGi application: ${error as Error}. You should run \`pnpm run package\` before running the tests to ensure the app is built, and build with binaries like "dugite" and "tiddlywiki", see scripts/afterPack.js for more details.`,
);
}
});

View file

@ -13,11 +13,10 @@
"start:dev:debug-main": "cross-env NODE_ENV=development DEBUG_MAIN=true electron-forge start",
"start:dev:debug-react": "cross-env NODE_ENV=development DEBUG_REACT=true electron-forge start",
"build:plugin": "zx scripts/compilePlugins.mjs",
"test": "pnpm run test:unit && pnpm run package:dev && pnpm run test:e2e",
"test": "pnpm run test:unit && pnpm run package && pnpm run test:e2e",
"test:unit": "jest",
"test:e2e": "cross-env NODE_ENV=test cucumber-js --config features/cucumber.config.js",
"package": "pnpm run build:plugin && electron-forge package",
"package:dev": "pnpm run build:plugin && cross-env NODE_ENV=test electron-forge package",
"package": "pnpm run build:plugin && cross-env NODE_ENV=test electron-forge package",
"make": "pnpm run build:plugin && cross-env NODE_ENV=production electron-forge make",
"init:git-submodule": "git submodule update --recursive && git submodule update --remote",
"lint": "eslint ./src --ext js,ts,tsx,json",