diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d3e4b9..b4c1340 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest] + os: [windows-latest, ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v7 @@ -25,20 +25,11 @@ jobs: - run: dotnet restore TdbIO.slnx - run: dotnet build TdbIO.slnx -c Release --no-restore - run: dotnet test TdbIO.slnx -c Release --no-build - - run: dotnet pack TdbIO.slnx -c Release --no-build -o artifacts - - uses: actions/upload-artifact@v7 + - if: matrix.os == 'windows-latest' + run: dotnet pack TdbIO.slnx -c Release --no-build -o artifacts + - if: matrix.os == 'windows-latest' + uses: actions/upload-artifact@v7 with: name: packages-${{ matrix.os }} path: artifacts/*.nupkg if-no-files-found: error - - build-linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - - uses: actions/setup-dotnet@v6 - with: - global-json-file: global.json - dotnet-version: | - 8.0.x - - run: dotnet build src/TdbIO.Cli/TdbIO.Cli.csproj -c Release diff --git a/tests/TdbIO.Tests/GzipTests.cs b/tests/TdbIO.Tests/GzipTests.cs index 54d8437..3c8d3a4 100644 --- a/tests/TdbIO.Tests/GzipTests.cs +++ b/tests/TdbIO.Tests/GzipTests.cs @@ -151,9 +151,12 @@ public void CorruptDeflateDataIsRejected() [Fact] public void PeekInflatesTheHeadOfCutData() { - byte[] file = Synthetic.Gzip(Payload); + // Deterministic uncompressed deflate block (BFINAL=0, BTYPE=00) of 32 bytes, + // ensuring the cut prefix inflates across all platforms without depending on platform-specific compression trees. + byte[] uncompressedBlock = [0x00, 0x20, 0x00, 0xDF, 0xFF]; + byte[] file = Synthetic.Concat([0x1F, 0x8B, 0x08, 0x00, 0, 0, 0, 0, 0, 0], uncompressedBlock, Payload[..32], [0x00]); var into = new byte[32]; - Assert.Equal(32, Gzip.Peek(file.AsSpan(0, file.Length / 2), into)); + Assert.Equal(32, Gzip.Peek(file, into)); Assert.Equal(Payload[..32], into); }