Skip to content

Commit

Permalink
updated actions
Browse files Browse the repository at this point in the history
  • Loading branch information
vpenades committed Apr 30, 2024
1 parent c5d7fef commit 833b2f9
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 8 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/BuildPackages.yml
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions InteropTypes.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void TestReinterpretBitmaps()

var dst = src.AsSpanBitmap().ReinterpretAs<Pixel.RGBA32>();

var p = dst.GetPixel(0, 0);
var p = dst.GetPixelUnchecked(0, 0);

Assert.Multiple(() =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ void _testSlice(PointerBitmap ptr)

var ptrSpan = ptr.AsSpanBitmapOfType<int>();

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<int>(4, 4, Pixel.ARGB32.Format);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<ProjectReference Include="..\..\src\InteropTypes.Codecs.STB\InteropTypes.Codecs.STB.csproj" />
<ProjectReference Include="..\..\src\InteropTypes.Graphics.Backends.ImageSharp\InteropTypes.Graphics.Backends.ImageSharp.csproj" />
<ProjectReference Include="..\..\src\InteropTypes.Graphics.Bitmaps.Toolkit\InteropTypes.Graphics.Bitmaps.Toolkit.csproj" />
<ProjectReference Include="..\..\src\InteropTypes.Tensors.OnnxRuntime\InteropTypes.Tensors.OnnxRuntime.csproj" />
<ProjectReference Include="..\..\src\InteropTypes.Tensors\InteropTypes.Tensors.csproj" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion tests/InteropTypes.Tensors.Tests/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down

0 comments on commit 833b2f9

Please sign in to comment.