Remote uses: @v1 never scheduled jobs; keep thin callers against local workflow_call copies until collaborative owners include Trent.
99 lines
3.6 KiB
YAML
99 lines
3.6 KiB
YAML
# Thin caller. Pipelines are local reusable workflows until Trent is listed under
|
|
# infra/ci-workflows Actions → collaborative owners; then switch uses: back to
|
|
# infra/ci-workflows/.gitea/workflows/{dotnet8,node}-ci.yml@v1.
|
|
# Path filter + changes job stay local (repo-specific).
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
paths:
|
|
- "VigilCareRecordsAPI/**"
|
|
- "VigilCareRecordsAPI.Tests/**"
|
|
- "vigilcare-records-web/**"
|
|
- "VigilCareRecords.sln"
|
|
- ".gitea/workflows/**"
|
|
pull_request:
|
|
branches: [main, master]
|
|
paths:
|
|
- "VigilCareRecordsAPI/**"
|
|
- "VigilCareRecordsAPI.Tests/**"
|
|
- "vigilcare-records-web/**"
|
|
- "VigilCareRecords.sln"
|
|
- ".gitea/workflows/**"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
# Stays local: repo-specific path map; needs fetch-depth: 0.
|
|
# Keep actions/checkout@v4 here until builtin:checkout is proven with fetch-depth: 0.
|
|
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
|
|
|
|
- id: filter
|
|
name: Detect stack changes
|
|
run: |
|
|
set -euo pipefail
|
|
backend=false
|
|
frontend=false
|
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
backend=true
|
|
frontend=true
|
|
else
|
|
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
|
base="${{ github.event.pull_request.base.sha }}"
|
|
else
|
|
base="${{ github.event.before }}"
|
|
fi
|
|
if [ -z "${base:-}" ] || [ "$base" = "0000000000000000000000000000000000000000" ]; then
|
|
backend=true
|
|
frontend=true
|
|
else
|
|
files="$(git diff --name-only "$base" "${{ github.sha }}")"
|
|
printf '%s\n' "$files"
|
|
if printf '%s\n' "$files" | grep -qE '^(VigilCareRecordsAPI/|VigilCareRecordsAPI\.Tests/|VigilCareRecords\.sln|\.gitea/workflows/)'; then
|
|
backend=true
|
|
fi
|
|
if printf '%s\n' "$files" | grep -qE '^(vigilcare-records-web/|\.gitea/workflows/)'; then
|
|
frontend=true
|
|
fi
|
|
fi
|
|
fi
|
|
echo "backend=${backend}" >> "$GITHUB_OUTPUT"
|
|
echo "frontend=${frontend}" >> "$GITHUB_OUTPUT"
|
|
|
|
backend:
|
|
needs: changes
|
|
if: needs.changes.outputs.backend == 'true'
|
|
uses: ./.gitea/workflows/dotnet8-ci.yml
|
|
with:
|
|
working_directory: .
|
|
solution: VigilCareRecords.sln
|
|
postgres_db: vigilcare_records_test
|
|
# Single test project (service-backed). No isolated/InMemory split today.
|
|
test_projects: |
|
|
VigilCareRecordsAPI.Tests/VigilCareRecordsAPI.Tests.csproj
|
|
# ApiFixture reads CONNECTIONSTRINGS__DEFAULTCONNECTION / REDIS__CONNECTIONSTRING
|
|
# (not the shared workflow's ConnectionStrings__Postgres / ConnectionStrings__Redis).
|
|
test_env: |
|
|
CONNECTIONSTRINGS__DEFAULTCONNECTION=Host=postgres;Port=5432;Database=vigilcare_records_test;Username=postgres;Password=postgres;SSL Mode=Disable
|
|
REDIS__CONNECTIONSTRING=redis:6379,defaultDatabase=1,allowAdmin=true
|
|
|
|
frontend:
|
|
needs: changes
|
|
if: needs.changes.outputs.frontend == 'true'
|
|
uses: ./.gitea/workflows/node-ci.yml
|
|
with:
|
|
working_directory: vigilcare-records-web
|
|
node_version: "22"
|
|
# Typecheck once here; build must not re-run vue-tsc.
|
|
lint_command: npm run typecheck
|
|
extra_check_command: npm run test:run
|
|
build_command: npx vite build
|