Skip to content

Commit e0d33a1

Browse files
Update test.yml
1 parent 8d1d98f commit e0d33a1

1 file changed

Lines changed: 12 additions & 18 deletions

File tree

.github/workflows/test.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,13 @@ jobs:
5454
found=false
5555
for proj in $(find . -name "*.Tests.csproj"); do
5656
found=true
57-
echo "Inspecting $proj for target frameworks..."
58-
5957
frameworks=$(grep -oPm1 "(?<=<TargetFrameworks>)[^<]+" "$proj" || true)
6058
if [ -z "$frameworks" ]; then
6159
frameworks=$(grep -oPm1 "(?<=<TargetFramework>)[^<]+" "$proj" || true)
6260
fi
63-
64-
if [ -z "$frameworks" ]; then
65-
echo "⚠️ No TargetFramework found in $proj, skipping..."
66-
continue
67-
fi
68-
6961
for fw in $(echo $frameworks | tr ';' ' '); do
70-
echo "Running tests for $proj ($fw)"
7162
results_dir="./TestResults/$fw"
7263
mkdir -p "$results_dir"
73-
7464
dotnet test "$proj" \
7565
--no-build \
7666
--configuration ${{ env.BUILD_CONFIGURATION }} \
@@ -79,36 +69,40 @@ jobs:
7969
--results-directory "$results_dir"
8070
done
8171
done
82-
8372
if [ "$found" = false ]; then
84-
echo "⚠️ No test projects (*.Tests.csproj) were found in this repository."
73+
echo "⚠️ No test projects (*.Tests.csproj) were found."
8574
exit 1
8675
fi
8776
88-
- name: Ensure .NET 9.0 results exist
77+
- name: Ensure .NET 9.0 Results Exist
8978
run: |
9079
mkdir -p ./TestResults/net9.0
9180
if ! compgen -G "./TestResults/net9.0/*.trx" > /dev/null; then
92-
echo "No .NET 9.0 test results" > ./TestResults/net9.0/placeholder.txt
81+
echo "⚠️ No .NET 9.0 test results" > ./TestResults/net9.0/placeholder.txt
9382
fi
9483
9584
- name: Upload .NET 9.0 Test Results
9685
uses: actions/upload-artifact@v4
9786
with:
9887
name: test-results-net9.0
99-
path: ./TestResults/net9.0/**
88+
# only upload trx + placeholder, ignore everything else
89+
path: |
90+
./TestResults/net9.0/*.trx
91+
./TestResults/net9.0/placeholder.txt
10092
overwrite: true
10193

102-
- name: Ensure .NET 8.0 results exist
94+
- name: Ensure .NET 8.0 Results Exist
10395
run: |
10496
mkdir -p ./TestResults/net8.0
10597
if ! compgen -G "./TestResults/net8.0/*.trx" > /dev/null; then
106-
echo "No .NET 8.0 test results" > ./TestResults/net8.0/placeholder.txt
98+
echo "⚠️ No .NET 8.0 test results" > ./TestResults/net8.0/placeholder.txt
10799
fi
108100
109101
- name: Upload .NET 8.0 Test Results
110102
uses: actions/upload-artifact@v4
111103
with:
112104
name: test-results-net8.0
113-
path: ./TestResults/net8.0/**
105+
path: |
106+
./TestResults/net8.0/*.trx
107+
./TestResults/net8.0/placeholder.txt
114108
overwrite: true

0 commit comments

Comments
 (0)