mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-07-26 11:49:16 +00:00
331dbe8339
Bumps the all-actions group with 3 updates in the / directory: [actions/setup-node](https://github.com/actions/setup-node), [softprops/action-gh-release](https://github.com/softprops/action-gh-release) and [actions/stale](https://github.com/actions/stale). Bumps the all-actions group with 1 update in the /.github/actions/start-app directory: [actions/setup-node](https://github.com/actions/setup-node). Updates `actions/setup-node` from 6.4.0 to 7.0.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e...820762786026740c76f36085b0efc47a31fe5020) Updates `softprops/action-gh-release` from 3.0.1 to 3.0.2 - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/718ea10b132b3b2eba29c1007bb80653f286566b...3d0d9888cb7fd7b750713d6e236d1fcb99157228) Updates `actions/stale` from 10.3.0 to 10.4.0 - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/stale/compare/eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899...1e223db275d687790206a7acac4d1a11bd6fe629) Updates `actions/setup-node` from 6.4.0 to 7.0.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e...820762786026740c76f36085b0efc47a31fe5020) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions - dependency-name: softprops/action-gh-release dependency-version: 3.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions - dependency-name: actions/stale dependency-version: 10.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all-actions - dependency-name: actions/setup-node dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
120 lines
4.2 KiB
YAML
120 lines
4.2 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: '1852'
|
|
skip-backend-build:
|
|
description: >
|
|
When 'true', skip running `npm run build` in backend/ and assume the
|
|
caller has already materialized backend/dist (e.g. via download-artifact
|
|
from an upstream job that already built and verified it). Leave 'false'
|
|
for standalone invocations that do not run in a job graph with a
|
|
prior build step.
|
|
required: false
|
|
default: 'false'
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
|
|
with:
|
|
node-version-file: '.node-version'
|
|
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
|
|
if: inputs.skip-backend-build != 'true'
|
|
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 and log dir
|
|
shell: bash
|
|
run: |
|
|
mkdir -p ${{ inputs.compose-dir }}
|
|
mkdir -p "${{ github.workspace }}/ci-logs"
|
|
|
|
# Log files live under $GITHUB_WORKSPACE so actions/upload-artifact@v4+ can
|
|
# include them alongside repo-relative paths like e2e/report/. Mixing those
|
|
# with /tmp paths makes '/' the common root and v4+ strips the absolute
|
|
# entries from the artifact. `stdbuf -oL -eL` forces line-buffered output
|
|
# so a crash doesn't lose the final few hundred lines to block buffering.
|
|
- name: Start backend
|
|
shell: bash
|
|
run: stdbuf -oL -eL node dist/index.js > "${{ github.workspace }}/ci-logs/backend.log" 2>&1 &
|
|
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: stdbuf -oL -eL npm run dev > "${{ github.workspace }}/ci-logs/frontend.log" 2>&1 &
|
|
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
|
|
|
|
# Playwright bundles Chrome for Testing (~170MB) and FFmpeg. Downloading
|
|
# them on every E2E run is the single largest cost in this composite:
|
|
# observed ~4m15s cold vs ~10s warm when the path is cached. Cache the
|
|
# download under a key pinned to the @playwright/test version so a
|
|
# future bump invalidates automatically.
|
|
- name: Read Playwright version
|
|
id: playwright-version
|
|
shell: bash
|
|
run: |
|
|
version=$(node -p "require('./package.json').devDependencies['@playwright/test'].replace(/^[\^~]/, '')")
|
|
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Cache Playwright browsers
|
|
id: playwright-cache
|
|
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ~/.cache/ms-playwright
|
|
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
|
|
|
|
# OS deps are apt packages under /var, which actions/cache does not
|
|
# preserve, so they have to be reinstalled every run regardless of the
|
|
# browser cache state. It is fast (~10s).
|
|
- name: Install Playwright OS dependencies
|
|
shell: bash
|
|
run: npx playwright install-deps chromium
|
|
|
|
- name: Install Playwright browsers
|
|
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
|
shell: bash
|
|
run: npx playwright install chromium
|