-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.57 KB
/
Copy pathpr-tests.yml
File metadata and controls
55 lines (46 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: PR Unit Tests
on:
pull_request:
branches:
- "**"
jobs:
test-gate:
name: PR Test Gate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
cache: true
cache-dependency-path: |
FluentAAS/**/*.csproj
FluentAAS/global.json
- name: Locate solution file
id: solution
shell: bash
run: |
SOLUTION=$(find . -maxdepth 5 -name "*.sln" | head -n 1)
if [ -z "$SOLUTION" ]; then
echo "❌ No solution file (*.sln) found in the repo."
exit 1
fi
echo "SOLUTION_PATH=$SOLUTION" >> $GITHUB_OUTPUT
echo "✅ Found solution: $SOLUTION"
- name: Restore dependencies
run: dotnet restore "${{ steps.solution.outputs.SOLUTION_PATH }}"
- name: Build solution
run: dotnet build "${{ steps.solution.outputs.SOLUTION_PATH }}" -c Release --no-restore
# Blocking PR gate: reviewers can see this check and it must pass before merge.
- name: Run unit tests (blocking gate)
run: dotnet test "${{ steps.solution.outputs.SOLUTION_PATH }}" -c Release --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx"
- name: Upload test result artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: pr-test-results
path: |
**/TestResults/*.trx
**/test-results.trx