Update build.yml #8
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 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: build_${{ github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| permissions: | |
| id-token: write # Allow action to get OIDC token from GitHub | |
| contents: read | |
| attestations: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 9.0.x | |
| - name: Define VERSION | |
| run: | | |
| echo "COMMIT=${GITHUB_SHA:0:7}" | |
| echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" | |
| echo "BRANCH=${GITHUB_REF##*/}" | |
| - name: Prebuild | |
| run: | | |
| dotnet build -c Debug || : | |
| - name: Build (Debug) | |
| run: dotnet build -c Debug | |
| - name: Test (Debug) | |
| run: dotnet test -c Debug --no-build -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura | |
| - name: Build (Release) | |
| run: dotnet build -c Release | |
| - name: Test (Release) | |
| run: dotnet test -c Release --no-build -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura | |
| - name: Upload Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| use_oidc: true | |
| fail_ci_if_error: false | |