Files
novelly/scripts/ci/test.sh
T
James Wampler 44f722019b
CI / build-and-push (push) Successful in 58s
CI / deploy (push) Successful in 10s
Mirror mic-check's Gitea/GitHub CI-CD pipeline for novelly
Dual-engine workflow (.github/workflows/ci.yml, read by both GitHub Actions
and Gitea Actions): build, test, coverage badge on every push; on Gitea main
pushes only, build+push API/web images to the Gitea registry and redeploy
the persistent LAN stack via the shared [self-hosted, qa] runner. Replaces
the ad hoc docker-compose.deploy.yml manual workflow with
deploy/qa/docker-compose.qa.yml, pulled by CI — data volume preserved
across deploys (no -v on down), unlike mic-check's throwaway QA stack.
2026-08-18 18:25:01 -07:00

23 lines
911 B
Bash
Executable File

#!/usr/bin/env bash
# Runs Novelly.Api.Tests with coverage collection. No web test suite exists yet
# (src/Novelly.Web/package.json has no "test" script) — nothing to run there.
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")" && source ./lib.sh
cd "$CI_ROOT"
ensure_dotnet
# Coverlet doesn't clear prior output — on a runner that reuses its workspace
# (self-hosted, unlike GitHub's ephemeral ones), stale coverage from past runs would
# otherwise get merged in by coverage.sh and silently skew the combined percentage.
rm -rf "$CI_ROOT/coverage/dotnet"
log "Running Novelly.Api.Tests"
dotnet test tests/Novelly.Api.Tests/Novelly.Api.Tests.csproj -c Release --logger trx \
/p:CollectCoverage=true /p:CoverletOutputFormat=cobertura \
/p:CoverletOutput="$CI_ROOT/coverage/dotnet/" \
/p:Exclude="[Novelly.ServiceDefaults]*" \
/p:ExcludeByFile="**/Data/Migrations/*.cs"
log "test.sh complete"