All tests built with net10.0, project-under-test is referenced with specific framework version #144
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: Build and Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - src/** | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - src/** | |
| workflow_dispatch: | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Get Short SHA | |
| id: vars | |
| run: echo "sha_short=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: 10.x | |
| - name: Restore dependencies | |
| run: dotnet restore src/ByteAether.Ulid.slnx -p:Configuration=CI-Debug | |
| - name: Build | |
| run: dotnet build src/ByteAether.Ulid.slnx --configuration CI-Debug --no-restore | |
| - name: Upload DLLs | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: dlls-${{ steps.vars.outputs.sha_short }} | |
| path: | | |
| ./**/Ulid/bin/**/*.dll | |
| ./**/EFCore/bin/**/*.dll | |
| ./**/LinqToDB/bin/**/*.dll | |
| ./**/Dapper/bin/**/*.dll | |
| - name: Run framework tests | |
| run: | | |
| frameworks=( | |
| "net10.0" | |
| "net9.0" | |
| "net8.0" | |
| "net7.0" | |
| "net6.0" | |
| "net5.0" | |
| "netstandard2.1" | |
| "netstandard2.0" | |
| ) | |
| failed=0 | |
| for tfm in "${frameworks[@]}"; do | |
| echo "::group::Testing $tfm" | |
| if ! dotnet test src/ByteAether.Ulid.slnx --configuration CI-Debug -p:ImplTargetFramework=$tfm --verbosity normal --logger "trx;LogFileName=results-$tfm.trx"; then | |
| echo "❌ Tests failed for $tfm" | |
| failed=1 | |
| fi | |
| echo "::endgroup::" | |
| done | |
| if [ $failed -eq 1 ]; then | |
| echo "One or more target framework tests failed." | |
| exit 1 | |
| fi | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: test-results-${{ steps.vars.outputs.sha_short }} | |
| path: ./**/TestResults/**/*.trx | |
| - name: Pack | |
| run: dotnet pack src/ByteAether.Ulid.slnx --configuration CI-Debug -p:ContinuousIntegrationBuild=true -p:PackageVersion=0.0.0-ci-${{ steps.vars.outputs.sha_short }} -p:PackageReleaseNotes="CI Build ${{ steps.vars.outputs.sha_short }}" --output ./output | |
| - name: Upload NuGet package | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: nugets-${{ steps.vars.outputs.sha_short }} | |
| path: ./output/*.nupkg |