chore: fix terraform backend config and commit provider lock file #2
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: .NET CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "**/*.cs" | |
| - "**/*.csproj" | |
| - "**/*.sln" | |
| - ".github/workflows/dotnet-ci.yml" | |
| concurrency: | |
| group: dotnet-ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "8.0.x" | |
| - name: Restore dependencies | |
| run: dotnet restore certinext-caplugin.sln | |
| - name: Build | |
| run: dotnet build certinext-caplugin.sln --no-restore --configuration Release | |
| - name: Run unit tests | |
| run: | | |
| dotnet test certinext-caplugin.sln \ | |
| --no-build \ | |
| --configuration Release \ | |
| --verbosity normal \ | |
| --collect:"XPlat Code Coverage" \ | |
| --results-directory /tmp/coverage | |
| - name: Generate coverage report | |
| run: | | |
| dotnet tool install -g dotnet-reportgenerator-globaltool 2>/dev/null || true | |
| reportgenerator \ | |
| -reports:"/tmp/coverage/**/coverage.cobertura.xml" \ | |
| -targetdir:/tmp/coverage-report \ | |
| -reporttypes:"MarkdownSummaryGithub;Cobertura" | |
| - name: Post coverage summary | |
| if: github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const summary = fs.readFileSync('/tmp/coverage-report/SummaryGithub.md', 'utf8'); | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: summary, | |
| }); | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: /tmp/coverage-report/ | |
| retention-days: 14 |