84 lines
3.0 KiB
YAML
84 lines
3.0 KiB
YAML
# What .gitea/workflows/ci.yml becomes once infra/ci-workflows exists and is tagged v1.
|
|
# STAGED — do not copy into .gitea/workflows/ until that repo is pushed and tagged,
|
|
# or every run fails to resolve the `uses:` reference.
|
|
#
|
|
# 241 lines -> ~75. What stays here is what a reusable workflow cannot take:
|
|
# the change-detection job needs fetch-depth: 0 and a repo-specific path map.
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
paths:
|
|
- "GrowthOS/**"
|
|
- ".gitea/workflows/**"
|
|
pull_request:
|
|
branches: [master, main]
|
|
paths:
|
|
- "GrowthOS/**"
|
|
- ".gitea/workflows/**"
|
|
|
|
jobs:
|
|
# Stays local: repo-specific path map, and it needs full history to diff against
|
|
# the merge base. Keep actions/checkout@v4 here unless the probe proves
|
|
# builtin:checkout honours fetch-depth: 0 — a silently shallow clone would make
|
|
# this filter skip real work while the run stays green.
|
|
changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
backend: ${{ steps.filter.outputs.backend }}
|
|
frontend: ${{ steps.filter.outputs.frontend }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Detect changed stacks
|
|
id: filter
|
|
run: |
|
|
# ... unchanged from the current ci.yml ...
|
|
echo "see .gitea/workflows/ci.yml for the body"
|
|
|
|
backend:
|
|
needs: changes
|
|
if: needs.changes.outputs.backend == 'true'
|
|
uses: infra/ci-workflows/.gitea/workflows/dotnet8-ci.yml@v1
|
|
with:
|
|
working_directory: GrowthOS
|
|
solution: GrowthOS.sln
|
|
postgres_db: growth_os_test
|
|
# Unit tests are InMemory. They must not see the service Postgres, or
|
|
# AppDbContextFactory connects to it and retries until the runner thrashes.
|
|
isolated_test_projects: |
|
|
tests/GrowthOS.UnitTests/GrowthOS.UnitTests.csproj
|
|
test_projects: |
|
|
tests/GrowthOS.IntegrationTests/GrowthOS.IntegrationTests.csproj
|
|
tests/GrowthOS.AgentEvals/GrowthOS.AgentEvals.csproj
|
|
test_env: |
|
|
Jwt__SigningKey=ci-test-jwt-secret-at-least-32-bytes-long!!
|
|
Gitea__DryRun=true
|
|
Gitea__BaseUrl=
|
|
Gitea__Token=
|
|
pre_build_command: |
|
|
set -euo pipefail
|
|
venv=/tmp/growth-seed
|
|
if ! python3 -m venv "$venv"; then
|
|
(sudo apt-get update -qq && sudo apt-get install -y -qq python3-venv) \
|
|
|| (apt-get update -qq && apt-get install -y -qq python3-venv)
|
|
python3 -m venv "$venv"
|
|
fi
|
|
"$venv/bin/pip" install --quiet --disable-pip-version-check pyyaml
|
|
"$venv/bin/python" GrowthOS/scripts/sync-growth-memory-seed.py --check
|
|
|
|
frontend:
|
|
needs: changes
|
|
if: needs.changes.outputs.frontend == 'true'
|
|
uses: infra/ci-workflows/.gitea/workflows/node-ci.yml@v1
|
|
with:
|
|
working_directory: GrowthOS/web
|
|
node_version: "22"
|
|
lint_command: npm run lint
|
|
extra_check_command: node scripts/check-prod-routing.mjs
|
|
build_command: npx vite build
|
|
build_env: |
|
|
VITE_API_BASE_URL=
|