Skip to content

Commit 9bda507

Browse files
committed
WIP #248 - Attempt to improve CI
This attempts to fix 2 issues: * Closing Xvfb gracefully * Running tests with just one TFM
1 parent 1518b3f commit 9bda507

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/dotnetCi.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
/s:$PWD/.sonarqube-analysisproperties.xml
8585
- name: Build the solution (one TFM only for performance)
8686
run: dotnet build -c ${{ env.Configuration }} --no-incremental -p:TargetFrameworks=${{ env.Tfm }}
87-
- name: Run .NET tests with coverage
87+
- name: Run .NET tests with coverage (one TFM only for performance)
8888
id: dotnet_tests
8989
continue-on-error: true
9090
run: |
@@ -93,7 +93,7 @@ jobs:
9393
projNameArray=(${proj//// })
9494
projName=${projNameArray[1]}
9595
assemblyPath=$proj/bin/$Configuration/$Tfm/$projName.dll
96-
coverlet "$assemblyPath" --target "dotnet" --targetargs "test $proj -c $Configuration --no-build -p:TargetFrameworks=$Tfm --logger:nunit --test-adapter-path:." -f=opencover -o="TestResults/$projName.opencover.xml"
96+
coverlet "$assemblyPath" --target "dotnet" --targetargs "test $proj -c $Configuration --no-build -p:TargetFramework=$Tfm --logger:nunit --test-adapter-path:." -f=opencover -o="TestResults/$projName.opencover.xml"
9797
if [ $? -ne 0 ]
9898
then
9999
echo "failures=true" >> $GITHUB_OUTPUT
@@ -117,7 +117,8 @@ jobs:
117117
run:
118118
dotnet sonarscanner end /d:sonar.token=${{ env.SonarCloudSecretKey }}
119119
- name: Gracefully stop Xvfb
120-
run: kill "%$(jobs -l | grep Xvfb | cut -d ' ' -f 1 | grep -Eo '[0-9]+')"
120+
run: kill $(jobs -l | grep Xvfb | cut -d ' ' -f 2)
121+
continue-on-error: true
121122
- name: Upload test results artifacts
122123
uses: actions/upload-artifact@v4
123124
with:
@@ -146,6 +147,11 @@ jobs:
146147
run: |
147148
echo "Failing the build due to test failures"
148149
exit 1
150+
151+
# Build the apps in release mode and publish artifacts
152+
153+
- name: Build in release configuration
154+
run: dotnet build -c Release
149155

150156
# buildDocs:
151157
# TODO: Build the docco site and package the result as an artifact, don't publish it

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"isDefault": true
3737
},
3838
"command": "dotnet",
39-
"args": ["test", "-p:TargetFrameworks=net8.0"],
39+
"args": ["test", "-p:TargetFramework=net8.0"],
4040
"problemMatcher": [],
4141
"label": "dotnet: test (net8.0 only)"
4242
},

0 commit comments

Comments
 (0)