66 branches : [ "main", "develop" ] # Or your primary branches
77 pull_request :
88 branches : [ "main", "develop" ]
9+ workflow_dispatch :
910
1011jobs :
1112 build-and-test :
@@ -16,45 +17,30 @@ jobs:
1617 node-version : [18.x] # Specify Node.js versions to test against
1718
1819 steps :
19- - name : Checkout repository
20- uses : actions/checkout@v4
20+ - name : Checkout repository
21+ uses : actions/checkout@v4
2122
22- - name : Set up Node.js ${{ matrix.node-version }}
23- uses : actions/setup-node@v4
24- with :
25- node-version : ${{ matrix.node-version }}
26- cache : " npm" # Enable caching for npm dependencies
23+ - name : Set up Node.js ${{ matrix.node-version }}
24+ uses : actions/setup-node@v4
25+ with :
26+ node-version : ${{ matrix.node-version }}
27+ cache : " npm" # Enable caching for npm dependencies
2728
28- - name : Install dependencies
29- - name : Run tests
30- run : npm test
31- run : npm ci # Use npm ci for cleaner installs in CI
29+ - name : Install dependencies
30+ run : npm ci
3231
33- - name : TypeScript Compile Check (Lint placeholder)
34- run : npm run build:electron:main && npm run build:electron:preload && npx tsc --project src/renderer/tsconfig.json --noEmit
35- # This checks if main, preload, and renderer TypeScript code compiles without errors.
36- # Replace with actual linting command when a linter is added.
32+ - name : Run tests
33+ run : npm test
3734
38- # Replace with `npm test` when Jest/React Testing Library tests are added.
35+ - name : TypeScript compile check
36+ run : npm run build:electron:main && npm run build:electron:preload && npx tsc --project src/renderer/tsconfig.json --noEmit
3937
40- - name : Build application (compiles main, preload, renderer)
41- run : npm run build
42- # This script typically runs:
43- # - vite build (for renderer)
44- # - tsc (for main and preload)
38+ - name : Build application
39+ run : npm run build
4540
46- - name : Package application (Linux AppImage example)
47- run : |
48- # Need to install dependencies for electron-builder to run on Linux
49- # sudo apt-get update
50- # sudo apt-get install -y --no-install-recommends libopenjp2-7 libgconf-2-4 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm1 libnss3 libasound2
51- # The above dependencies might be needed for a full AppImage build with GUI tests.
52- # For a headless build check or if runner has them, might not be needed.
53- # For now, we focus on the command itself.
54- npm run package -- --linux AppImage --dir # Build unpacked dir first to check
55- # npm run package -- --linux AppImage # Build the actual AppImage
56- # Note: Full GUI app packaging might be complex in headless CI environments
57- # without specific display servers (e.g., Xvfb). For now, this is a structural step.
41+ - name : Package application (Linux AppImage)
42+ if : github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
43+ run : npm run package -- --linux AppImage --dir
5844
5945 # Optional: Upload build artifacts (e.g., the AppImage)
6046 # - name: Upload Linux Build Artifact
0 commit comments