diff --git a/.github/workflows/BuildPackages.yml b/.github/workflows/BuildPackages.yml new file mode 100644 index 0000000..3573169 --- /dev/null +++ b/.github/workflows/BuildPackages.yml @@ -0,0 +1,70 @@ +name: Build packages and store artifacts + +on: workflow_dispatch + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + + # --------------------------------------------- DotNet SDK + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + + # --------------------------------------------- Android SDK + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'zulu' + + - name: Setup Android SDK + uses: android-actions/setup-android@v3 + + # --------------------------------------------- Workloads + + - name: Install Workload + run: dotnet workload install maui-windows android wasm-tools wasi-experimental # ois and maui-ios are not supported in ubuntu machines https://github.com/dotnet/maui/issues/15929 + + # --------------------------------------------- checkout repo + + - name: Checkout + uses: actions/checkout@v4 + + - name: Install dependencies + run: dotnet tool restore + + - name: Install dependencies + run: dotnet restore src/build.sln + + # - name: Create build solution + # run: dotnet slngen -c Release -o build.sln --launch false src\**\*.csproj + + - name: define version suffix + run: echo "VERSIONSUFFIX=Preview-$(date +'%Y%m%d-%H%M')" >> $GITHUB_ENV + + - name: define version suffix + run: echo "VERSIONSUFFIXSHORT=Prv-$(date +'%Y%m%d-%H%M')" >> $GITHUB_ENV + + - name: Build + run: dotnet build src/build.sln -c Release --version-suffix ${{env.VERSIONSUFFIX}} + +# - name: Test +# run: dotnet test -c Release --no-build + + - name: Pack nugets + run: dotnet pack src/build.sln -c Release --no-build --output . + + - name: Pack sources + run: dotnet PackAsSourcesNuget src/build.sln --output . --append-sources-suffix true --version-suffix ${{env.VERSIONSUFFIXSHORT}} + + - name: Archive code coverage results + uses: actions/upload-artifact@v4 + with: + name: nuget packages + path: | + *.nupkg + *.snupkg \ No newline at end of file diff --git a/.github/workflows/publishPreview.yml b/.github/workflows/publishBuiltPackagesToNuget.yml similarity index 100% rename from .github/workflows/publishPreview.yml rename to .github/workflows/publishBuiltPackagesToNuget.yml diff --git a/.github/workflows/publishSourcePackages.yml b/.github/workflows/publishSourcePackagesToNuget.yml similarity index 100% rename from .github/workflows/publishSourcePackages.yml rename to .github/workflows/publishSourcePackagesToNuget.yml diff --git a/InteropTypes.sln b/InteropTypes.sln index f045317..ddd88b8 100644 --- a/InteropTypes.sln +++ b/InteropTypes.sln @@ -30,11 +30,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig src\ApiChangeAnalyzer.props = src\ApiChangeAnalyzer.props src\build-preview.cmd = src\build-preview.cmd + .github\workflows\BuildPackages.yml = .github\workflows\BuildPackages.yml Directory.Packages.props = Directory.Packages.props src\Shared\Encoded7BitInt32.cs = src\Shared\Encoded7BitInt32.cs Project Hierarchy.dgml = Project Hierarchy.dgml - .github\workflows\publishPreview.yml = .github\workflows\publishPreview.yml - .github\workflows\publishSourcePackages.yml = .github\workflows\publishSourcePackages.yml + .github\workflows\publishBuiltPackagesToNuget.yml = .github\workflows\publishBuiltPackagesToNuget.yml + .github\workflows\publishSourcePackagesToNuget.yml = .github\workflows\publishSourcePackagesToNuget.yml README.md = README.md EndProjectSection EndProject diff --git a/tests/InteropTypes.Graphics.Bitmaps.Tests/Core/ConversionTests.cs b/tests/InteropTypes.Graphics.Bitmaps.Tests/Core/ConversionTests.cs index b9e29e6..38312e4 100644 --- a/tests/InteropTypes.Graphics.Bitmaps.Tests/Core/ConversionTests.cs +++ b/tests/InteropTypes.Graphics.Bitmaps.Tests/Core/ConversionTests.cs @@ -39,7 +39,7 @@ public void TestReinterpretBitmaps() var dst = src.AsSpanBitmap().ReinterpretAs(); - var p = dst.GetPixel(0, 0); + var p = dst.GetPixelUnchecked(0, 0); Assert.Multiple(() => { diff --git a/tests/InteropTypes.Graphics.Bitmaps.Tests/Core/PointerBitmapTests.cs b/tests/InteropTypes.Graphics.Bitmaps.Tests/Core/PointerBitmapTests.cs index 1a71fa8..f1ff669 100644 --- a/tests/InteropTypes.Graphics.Bitmaps.Tests/Core/PointerBitmapTests.cs +++ b/tests/InteropTypes.Graphics.Bitmaps.Tests/Core/PointerBitmapTests.cs @@ -27,10 +27,10 @@ void _testSlice(PointerBitmap ptr) var ptrSpan = ptr.AsSpanBitmapOfType(); - Assert.That(ptrSpan.GetPixel(0, 0), Is.Zero); - Assert.That(ptrSpan.GetPixel(1, 0), Is.Zero); - Assert.That(ptrSpan.GetPixel(0, 1), Is.Zero); - Assert.That(ptrSpan.GetPixel(1, 1), Is.Zero); + Assert.That(ptrSpan.GetPixelUnchecked(0, 0), Is.Zero); + Assert.That(ptrSpan.GetPixelUnchecked(1, 0), Is.Zero); + Assert.That(ptrSpan.GetPixelUnchecked(0, 1), Is.Zero); + Assert.That(ptrSpan.GetPixelUnchecked(1, 1), Is.Zero); } var bmp = new MemoryBitmap(4, 4, Pixel.ARGB32.Format); diff --git a/tests/InteropTypes.Tensors.Tests/InteropTypes.Tensors.Tests.csproj b/tests/InteropTypes.Tensors.Tests/InteropTypes.Tensors.Tests.csproj index 57ad802..bf034f0 100644 --- a/tests/InteropTypes.Tensors.Tests/InteropTypes.Tensors.Tests.csproj +++ b/tests/InteropTypes.Tensors.Tests/InteropTypes.Tensors.Tests.csproj @@ -18,6 +18,7 @@ + diff --git a/tests/InteropTypes.Tensors.Tests/UnitTest1.cs b/tests/InteropTypes.Tensors.Tests/UnitTest1.cs index 3a24831..5f823ef 100644 --- a/tests/InteropTypes.Tensors.Tests/UnitTest1.cs +++ b/tests/InteropTypes.Tensors.Tests/UnitTest1.cs @@ -120,7 +120,7 @@ public void PointCloudFitting() combined.SVD(w, v); } - + [Explicit("This is just a test to check the funcionality of TensorPrimitives")] [Test] public void MultiplyAddTest() {