Skip to content

Commit 4b2d3d5

Browse files
committed
Refactor CI workflow to enhance test result handling and improve security scan output
1 parent 08067d2 commit 4b2d3d5

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ jobs:
3131
- name: Build
3232
run: dotnet build --configuration Release --no-restore
3333

34-
- name: Run tests
35-
run: dotnet test --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx"
34+
- name: Test with dotnet
35+
run: dotnet test --no-restore --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
3636

37-
- name: Upload test results
37+
- name: Upload dotnet test results
3838
uses: actions/upload-artifact@v4
39-
if: always()
4039
with:
41-
name: test-results-${{ matrix.os }}
42-
path: '**/TestResults/*.trx'
40+
name: dotnet-results-${{ matrix.dotnet-version }}
41+
path: TestResults-${{ matrix.dotnet-version }}
42+
if: ${{ always() }}
4343

4444
lint:
45-
name: Lint and Format Check
45+
name: Lint/Format Check
4646
runs-on: ubuntu-latest
4747

4848
steps:
@@ -60,9 +60,6 @@ jobs:
6060
- name: Check formatting
6161
run: dotnet format --verify-no-changes --verbosity diagnostic
6262

63-
- name: Run code analysis
64-
run: dotnet build --configuration Release /p:TreatWarningsAsErrors=false
65-
6663
security:
6764
name: Security Scan
6865
runs-on: ubuntu-latest
@@ -79,5 +76,8 @@ jobs:
7976
- name: Restore dependencies
8077
run: dotnet restore
8178

82-
- name: Check for vulnerable packages
83-
run: dotnet list package --vulnerable --include-transitive
79+
- name: Checking for external vulnerabilites
80+
run: |
81+
dotnet list package --vulnerable --include-transitive 2>&1 | tee vuln.log
82+
echo "Analyze dotnet list package..."
83+
! grep -q -i "has the following vulnerable packages" vuln.log

0 commit comments

Comments
 (0)