Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 8 additions & 33 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
name: Build and Deploy to GitHub Pages
name: CI Validate Pull Request

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
name: Build Application
validate:
name: Build and Test
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -57,24 +48,8 @@ jobs:
echo "Server did not respond after 60s"
exit 1

- name: Build application
run: npm run build
- name: Run E2E tests
run: npx cucumber-js

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist

deploy:
name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Build application
run: npx vite build
105 changes: 105 additions & 0 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: CI – Dev Branch

on:
push:
branches:
- Dev

permissions:
contents: read

jobs:
# ------------------------------------------------------------------
# 1. Run all E2E tests
# ------------------------------------------------------------------
test:
name: E2E Tests
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Install Playwright browser and system dependencies
run: npx playwright install --with-deps chromium

- name: Start dev server
run: nohup npx vite --host > /tmp/vite.log 2>&1 &

- name: Wait for dev server
run: |
echo "Waiting for Vite dev server..."
for i in $(seq 1 30); do
if curl -sf http://localhost:5173/SolutionInventory/ > /dev/null 2>&1; then
echo "Server is up after ${i} attempts"
exit 0
fi
echo "Attempt $i failed, retrying in 2s..."
sleep 2
done
echo "--- Vite log ---"
cat /tmp/vite.log
echo "Server did not respond after 60s"
exit 1

- name: Run E2E tests
run: npx cucumber-js

# ------------------------------------------------------------------
# 2. Verify Electron app builds (no release, no publish)
# ------------------------------------------------------------------
build-electron-check:
name: Electron Build Check (${{ matrix.artifact_name }})
needs: test
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact_name: linux-x64
electron_flags: --linux --x64
- os: windows-latest
artifact_name: windows-x64
electron_flags: --win --x64

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install system dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libx11-xcb1 libxrandr2 libxcomposite1 libxcursor1 libxdamage1 \
libxfixes3 libxi6 libgtk-3-0t64 libatk1.0-0t64 libcairo-gobject2 \
libgdk-pixbuf-2.0-0 libasound2t64 libgtk-4-1 libvulkan1 libopus0 \
libgstreamer1.0-0 libgstreamer-plugins-base1.0-0 \
libgstreamer-plugins-bad1.0-0 libflite1 libwebp7 libharfbuzz-icu0 \
libwayland-server0 libmanette-0.2-0 libenchant-2-2 libgbm1 libdrm2 \
libhyphen0 libgles2 rpm fakeroot dpkg

- name: Install dependencies
run: npm ci

- name: Build Vite + Electron app (no publish)
run: npx vite build --mode electron && npx electron-builder ${{ matrix.electron_flags }} --publish never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading