This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build + Dependency Check | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-and-scan: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # Setup .NET | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.x | |
| # Restore dependencies | |
| - name: Restore | |
| run: dotnet restore | |
| # Build project | |
| - name: Build | |
| run: dotnet build --no-restore --configuration Release | |
| # Cache Dependency-Check DB (IMPORTANT for speed) | |
| - name: Cache Dependency-Check data | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.dependency-check | |
| key: dependency-check-${{ runner.os }} | |
| restore-keys: | | |
| dependency-check- | |
| # Run OWASP Dependency Check | |
| - name: OWASP Dependency Check | |
| uses: dependency-check/Dependency-Check_Action@main | |
| with: | |
| project: "cas-dotnet-sdk" | |
| path: "." | |
| format: "HTML" | |
| out: "dependency-check-report" | |
| args: > | |
| --failOnCVSS 7 | |
| --enableRetired | |
| # Upload report as artifact | |
| - name: Upload Dependency Check Report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dependency-check-report | |
| path: dependency-check-report |