diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index c053238..2d59bef 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -21,6 +21,10 @@ jobs: - name: Checkout code uses: actions/checkout@v6 + - 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@v5 with: @@ -38,6 +42,12 @@ jobs: - name: Build run: dotnet build --no-restore --configuration Release src/ByteAether.Ulid.sln + - name: Upload DLLs + uses: actions/upload-artifact@v6 + with: + name: dlls-${{ steps.vars.outputs.sha_short }} + path: ./**/ByteAether.Ulid/bin/**/*.dll + - name: Run tests continue-on-error: true run: dotnet test --no-build --verbosity normal --logger "trx" --configuration Release src/ByteAether.Ulid.sln @@ -45,5 +55,14 @@ jobs: - name: Upload test results uses: actions/upload-artifact@v6 with: - name: test-results + name: test-results-${{ steps.vars.outputs.sha_short }} path: ./**/TestResults/**/*.trx + + - name: Pack + run: dotnet pack --configuration Release /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 src/ByteAether.Ulid/ByteAether.Ulid.csproj + + - name: Upload NuGet package + uses: actions/upload-artifact@v6 + with: + name: nugets-${{ steps.vars.outputs.sha_short }} + path: ./output/*.nupkg diff --git a/src/ByteAether.Ulid.Tests/Ulid.New.Tests.cs b/src/ByteAether.Ulid.Tests/Ulid.New.Tests.cs index 0e9a351..e4f8f05 100644 --- a/src/ByteAether.Ulid.Tests/Ulid.New.Tests.cs +++ b/src/ByteAether.Ulid.Tests/Ulid.New.Tests.cs @@ -17,9 +17,9 @@ public class UlidNewTests /// /// A controllable random provider for testing purposes. It returns pre-configured byte sequences. /// - private class ControllableRandomProvider(params byte[][] ByteSequences) : IRandomProvider + private class ControllableRandomProvider(params byte[][] byteSequences) : IRandomProvider { - private readonly Queue _byteSequences = new(ByteSequences); + private readonly Queue _byteSequences = new(byteSequences); public void GetBytes(Span buffer) {