29 lines
1.0 KiB
Bash
Executable File
29 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
dotnet_bin="${DOTNET_TEST_BIN:-/usr/local/share/dotnet/dotnet}"
|
|
results_dir="${repo_dir}/artifacts/test-results"
|
|
nuget_cache="${UM_TRACE_NUGET_CACHE:-${TMPDIR:-/tmp}/um-trace-ci-nuget}"
|
|
|
|
mkdir -p "${results_dir}" "${nuget_cache}/http-cache"
|
|
|
|
export NUGET_HTTP_CACHE_PATH="${NUGET_HTTP_CACHE_PATH:-${nuget_cache}/http-cache}"
|
|
|
|
test_projects=(
|
|
"tests/FieldLogger.Sync.Tests/FieldLogger.Sync.Tests.csproj"
|
|
"tests/FieldLogger.Tests/FieldLogger.Tests.csproj"
|
|
"tests/IfLoc.Sim.Tests/IfLoc.Sim.Tests.csproj"
|
|
)
|
|
|
|
for project in "${test_projects[@]}"; do
|
|
project_name="$(basename "${project}" .csproj)"
|
|
DOTNET_ROOT=/usr/local/share/dotnet "${dotnet_bin}" restore "${repo_dir}/${project}" \
|
|
-p:NuGetAudit=false
|
|
DOTNET_ROOT=/usr/local/share/dotnet "${dotnet_bin}" test "${repo_dir}/${project}" \
|
|
--configuration Release \
|
|
--no-restore \
|
|
--logger "trx;LogFileName=${project_name}.trx" \
|
|
--results-directory "${results_dir}"
|
|
done
|