22
33on :
44 push :
5- branches : [ main, master, develop ]
5+ branches : [ main, master ]
66 pull_request :
77 branches : [ main, master ]
88
99permissions :
1010 contents : read
1111 checks : write
1212 pull-requests : write
13- statuses : write
1413
1514jobs :
1615 test :
@@ -27,22 +26,13 @@ jobs:
2726 dotnet-version : ' 9.0.x'
2827
2928 - name : 📦 Restore Dependencies
30- run : dotnet restore EventTicketing.Tests/
29+ run : dotnet restore
3130
3231 - name : 🏗️ Build Project
33- run : dotnet build EventTicketing.Tests/ --no-restore --configuration Release
32+ run : dotnet build --no-restore --configuration Release
3433
3534 - name : 🧪 Run Tests
36- run : |
37- dotnet test EventTicketing.Tests/ \
38- --no-build \
39- --configuration Release \
40- --verbosity normal \
41- --logger trx \
42- --logger "console;verbosity=detailed" \
43- --results-directory "TestResults" \
44- --collect:"XPlat Code Coverage" \
45- --settings coverlet.runsettings
35+ run : dotnet test EventTicketing.Tests/ --no-build --configuration Release --verbosity normal --logger trx --results-directory TestResults
4636
4737 - name : 📊 Publish Test Results
4838 uses : EnricoMi/publish-unit-test-result-action@v2
5141 files : TestResults/**/*.trx
5242 check_name : " 🧪 Test Results"
5343 comment_title : " 🎯 Test Summary"
54-
55- - name : 📈 Upload Coverage to Codecov
56- uses : codecov/codecov-action@v3
57- if : always()
58- with :
59- file : TestResults/*/coverage.cobertura.xml
60- flags : unittests
61- name : codecov-umbrella
62- fail_ci_if_error : false
6344
6445 build :
6546 name : 🏗️ Build & Analyze
@@ -81,53 +62,24 @@ jobs:
8162 - name : 🏗️ Build API
8263 run : dotnet build EventTicketing.API/ --configuration Release --no-restore
8364
84- - name : 🔍 Run Code Analysis
85- run : dotnet format --verify-no-changes --verbosity diagnostic
86- continue-on-error : true
87-
8865 - name : 🏷️ Create Build Artifact
8966 if : github.ref == 'refs/heads/main'
9067 run : dotnet publish EventTicketing.API/ -c Release -o ./publish
9168
9269 - name : 📤 Upload Build Artifact
9370 if : github.ref == 'refs/heads/main'
94- uses : actions/upload-artifact@v3
71+ uses : actions/upload-artifact@v4
9572 with :
9673 name : eventhub-api-${{ github.sha }}
9774 path : ./publish
9875
99- security :
100- name : 🔒 Security Scan
101- runs-on : ubuntu-latest
102-
103- steps :
104- - name : 📥 Checkout Code
105- uses : actions/checkout@v4
106-
107- - name : 🔐 Run Trivy vulnerability scanner
108- uses : aquasecurity/trivy-action@master
109- with :
110- scan-type : ' fs'
111- scan-ref : ' .'
112- format : ' sarif'
113- output : ' trivy-results.sarif'
114-
115- - name : 📊 Upload Trivy scan results
116- uses : github/codeql-action/upload-sarif@v2
117- if : always()
118- with :
119- sarif_file : ' trivy-results.sarif'
120-
12176 quality :
12277 name : 📋 Quality Gate
12378 runs-on : ubuntu-latest
12479 needs : [test, build]
12580 if : always()
12681
12782 steps :
128- - name : 📥 Checkout Code
129- uses : actions/checkout@v4
130-
13183 - name : ✅ Quality Gate Status
13284 run : |
13385 echo "🎯 Quality Gate Summary:"
0 commit comments