mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-12 19:57:37 +00:00
8d3cae78e1
* ci: optimize workflows to cut redundant runs and add timeout protection Skip validation jobs (build, test, lint, Docker, E2E) on push-to-main since code was already validated on the PR. Skip CI entirely for release-please PRs (version bump only). Add timeout-minutes to all jobs to prevent hung runners from burning 360 min (GitHub default). Add npm caching to the start-app composite action. Add concurrency control to docker-publish. Group Dependabot updates to batch PRs per ecosystem. Estimated savings: ~10 min per release cycle, ~30-40 min/day. * chore: add tsbuildinfo to gitignore
76 lines
1.9 KiB
YAML
76 lines
1.9 KiB
YAML
name: Start Sencho App
|
|
description: >
|
|
Shared setup for integration jobs: installs deps, builds backend,
|
|
starts backend + frontend dev servers, waits for readiness,
|
|
and installs Playwright browsers.
|
|
|
|
inputs:
|
|
jwt-secret:
|
|
required: false
|
|
default: 'ci-test-secret-key-not-for-production'
|
|
compose-dir:
|
|
required: false
|
|
default: '/tmp/compose'
|
|
port:
|
|
required: false
|
|
default: '3000'
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: |
|
|
package-lock.json
|
|
backend/package-lock.json
|
|
frontend/package-lock.json
|
|
|
|
- name: Install root dependencies (Playwright)
|
|
shell: bash
|
|
run: npm ci
|
|
|
|
- name: Install backend dependencies
|
|
shell: bash
|
|
run: npm ci
|
|
working-directory: ./backend
|
|
|
|
- name: Build backend
|
|
shell: bash
|
|
run: npm run build
|
|
working-directory: ./backend
|
|
|
|
- name: Install frontend dependencies
|
|
shell: bash
|
|
run: npm ci
|
|
working-directory: ./frontend
|
|
|
|
- name: Create compose directory
|
|
shell: bash
|
|
run: mkdir -p ${{ inputs.compose-dir }}
|
|
|
|
- name: Start backend
|
|
shell: bash
|
|
run: node dist/index.js &
|
|
working-directory: ./backend
|
|
env:
|
|
JWT_SECRET: ${{ inputs.jwt-secret }}
|
|
COMPOSE_DIR: ${{ inputs.compose-dir }}
|
|
PORT: ${{ inputs.port }}
|
|
NODE_ENV: test
|
|
|
|
- name: Start frontend dev server
|
|
shell: bash
|
|
run: npm run dev &
|
|
working-directory: ./frontend
|
|
|
|
- name: Wait for services to be ready
|
|
shell: bash
|
|
run: npx wait-on http://localhost:${{ inputs.port }}/api/health http://localhost:5173 --timeout 30000
|
|
|
|
- name: Install Playwright browsers
|
|
shell: bash
|
|
run: npx playwright install --with-deps chromium
|