release 0.0.2 with quality gates #12
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-and-test | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| DOTNET_VERSION: '10.0.x' | |
| jobs: | |
| build-and-test: | |
| name: build-and-test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Restore | |
| run: dotnet restore ManagedCode.FileContext.slnx | |
| - name: Verify formatting | |
| run: dotnet format ManagedCode.FileContext.slnx --verify-no-changes --no-restore | |
| - name: Build | |
| run: dotnet build ManagedCode.FileContext.slnx --configuration Release --no-restore | |
| - name: Test with coverage | |
| run: dotnet test tests/ManagedCode.FileContext.Tests/ManagedCode.FileContext.Tests.csproj --configuration Release --no-build /p:CollectCoverage=true /p:CoverletOutput=${{ github.workspace }}/TestResults/coverage | |
| - name: Pack | |
| run: dotnet pack src/ManagedCode.FileContext/ManagedCode.FileContext.csproj --configuration Release --no-build --output artifacts | |
| - name: Upload coverage | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage | |
| path: TestResults/coverage.opencover.xml | |
| if-no-files-found: error | |
| retention-days: 7 | |
| - name: Upload package | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: package | |
| path: artifacts/*.nupkg | |
| if-no-files-found: error | |
| retention-days: 7 |