Skip to content

Commit

Permalink
ci: update workflow to support only Node.js 22.x and 24.x
Browse files Browse the repository at this point in the history
- Remove support for older Node.js versions
- Add npm rebuild electron step
- Increase debug output for WebdriverIO
- Make format and lint checks non-blocking
- Update engine requirements
  • Loading branch information
prompt-mixer committed Oct 27, 2024
1 parent 2add15b commit f0c82c0
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Test

on:
push:
branches: [ '*' ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x, 24.x]
fail-fast: false # Continue with other versions if one fails

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: |
# Force install specific electron version to ensure compatibility
npm ci
# Ensure electron is properly installed for the tests
npm rebuild electron
- name: Format check
run: npm run format:check || true

- name: Lint
run: npm run lint || true

- name: Build
run: npm run react-build

- name: Install Chrome
uses: browser-actions/setup-chrome@latest
with:
chrome-version: stable

- name: Start application and run E2E tests
env:
TEST: 'true'
CI: 'true'
DISPLAY: ':99'
run: |
# Start Xvfb
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
sleep 5
# Run the tests with increased timeout and debugging
DEBUG=wdio* WDIO_LOG_LEVEL=debug npm test
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: test-artifacts
path: |
tests/e2e/logs/**
tests/e2e/screenshots/**
tests/e2e/videos/**
wdio-logs/**
if-no-files-found: ignore
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
"email": "[email protected]"
},
"license": "UNLICENSED",
"engines": {
"node": ">=22.0.0",
"npm": ">=10.0.0"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@electron/notarize": "^2.4.0",
Expand Down

0 comments on commit f0c82c0

Please sign in to comment.