Bump TUnit from 1.3.15 to 1.5.6 #770
Workflow file for this run
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: Continuous | |
| on: | |
| # PRs will be built, and a package posted to GH Packages | |
| pull_request: | |
| workflow_dispatch: | |
| push: | |
| paths-ignore: | |
| - 'README.md' | |
| - 'docs/**' | |
| # We'll build, pack, and push a pre-release to NuGet on master | |
| branches: [ master ] | |
| # Tagging with v* will build that version number and push a release to Nuget | |
| # e.g. v1.2, v3.4.5, etc. | |
| tags: | |
| - 'v*' | |
| defaults: | |
| run: | |
| shell: pwsh | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@v5 | |
| - name: NuGet restore | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Test | |
| run: dotnet test --configuration Release --no-build --verbosity normal | |
| # Package Release | |
| - name: Pack | |
| run: | | |
| <# If we're a tag, force VersionPrefix to the tag value #> | |
| if ('${{ github.ref }}' -match '^refs/tags/v') { | |
| $match = [regex]::Match('${{ github.ref }}', '^refs/tags/v([0-9]+(\.[0-9]+){1,2})') | |
| if ($match.Success) { | |
| $env:VersionPrefix = $match.Groups[1].Value | |
| } else { | |
| throw 'Invalid tag version: ${{ github.ref }}' | |
| } | |
| } | |
| else { | |
| <# All other pushes get a CI suffix #> | |
| $env:VersionSuffix = 'ci{0:0000}' -f ${{ github.run_number }} | |
| } | |
| dotnet pack /p:ContinuousIntegrationBuild=true --configuration Release --verbosity normal --output . | |
| - name: Upload NuGet | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: NuGet | |
| if-no-files-found: error | |
| path: | | |
| **/*.nupkg | |
| **/*.snupkg | |
| # Test that MSBuild properties to disable generators work correctly | |
| - name: Test Generator Disable Properties | |
| run: | | |
| <# Create a local NuGet source directory with the packed packages #> | |
| New-Item -ItemType Directory -Force -Path ./nupkgs | |
| Copy-Item -Path *.nupkg -Destination ./nupkgs/ | |
| <# Build and run the disable tests using the local NuGet package #> | |
| <# The test project's NuGet.config points to ../../nupkgs relative to the project #> | |
| dotnet test --project ./GeneratorTests/Moq.AutoMock.Generator.DisableTests/Moq.AutoMock.Generator.DisableTests.csproj ` | |
| --configuration Release ` | |
| --verbosity normal ` | |
| /p:LocalNuGetSource=true | |
| # Update the docs | |
| - name: Update Docs | |
| if: github.event_name == 'push' | |
| run: | | |
| dotnet tool install xmldocmd | |
| dotnet tool run xmldocmd .\Moq.AutoMock\bin\Release\net461\Moq.AutoMock.dll .\docs | |
| $modified = $(git status -u --porcelain) | |
| if ($modified.Where({$_.Contains(" docs/")}, 'First').Count -lt 1) { | |
| return 0 | |
| } | |
| # Create docs pull request | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v7 | |
| if: github.event_name == 'push' | |
| with: | |
| commit-message: | | |
| [Docs update detected by Github Action]. | |
| Auto generated pull request. | |
| branch: docs/automated-update | |
| delete-branch: true | |
| base: master | |
| title: Update Docs [GitHub Action] | |
| body: | | |
| [Docs update detected by Github Action]. | |
| Auto generated pull request. | |
| # Publish to NuGet and GitHub Packages | |
| - name: Publish | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| run: | | |
| dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }} --skip-duplicate | |
| dotnet nuget push *.nupkg ` | |
| --source 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json' ` | |
| --api-key '${{ github.token }}' ` | |
| --skip-duplicate | |
| automerge: | |
| if: github.event_name == 'pull_request' | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| steps: | |
| - uses: fastify/[email protected] |