Refactor Jenkinsfile to remove redundant environment configuration an… #39
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| linux-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore TownSuite.Dapper.Extras.sln | |
| - name: Build | |
| run: dotnet build TownSuite.Dapper.Extras.sln -c Release | |
| - name: Test | |
| run: cwd=`pwd` && dotnet test "TownSuite.DapperExtras.Tests/bin/Release/net8.0/TownSuite.DapperExtras.Tests.dll" --logger:"trx;LogFileName=$cwd/TownSuite.DapperExtras.Tests/bin/Release/net8.0/nunit-result.trx" | |
| - name: Archive test results | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: test-results | |
| path: | | |
| TownSuite.DapperExtras.Tests/bin/Release/net8.0/nunit-result.trx | |
| retention-days: 1 | |
| - name: Archive nuget package | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: "TownSuite.DapperExtras.AnyCPU" | |
| path: | | |
| TownSuite.DapperExtras/bin/Release/*.nupkg | |
| retention-days: 1 |