Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 38 additions & 5 deletions .github/workflows/ci-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,46 @@ jobs:

- name: Restore Dependencies
run: |
echo "Restoring NuGet packages for QRCoder.Core.sln"
dotnet restore QRCoder.Core.sln --no-cache --force --verbosity normal
dotnet restore QRCoder.Core.sln

- name: Build Solution
- name: Build Project
run: |
echo "Building QRCoder.Core.sln"
dotnet build QRCoder.Core.sln --no-restore --configuration Release --verbosity minimal
dotnet build QRCoder.Core.sln --configuration Release --no-restore

- name: Copy SkiaSharp Native Libraries
run: |
echo "Copying SkiaSharp native libraries to output directories"
# Find and copy libSkiaSharp.so to all test output directories
find ~/.nuget/packages -name "libSkiaSharp.so" -type f | while read file; do
echo "Found SkiaSharp library: $file"
# Copy to all framework output directories
for framework in netstandard2.1 net8.0 net10.0; do
target_dir="QRCoder.Core.Tests/bin/Release/$framework"
if [ -d "$target_dir" ]; then
cp "$file" "$target_dir/"
echo "Copied to $target_dir/"
fi
done
done
# Also try to copy from runtimes directory if available
find ~/.nuget/packages -path "*/runtimes/linux-x64/native/*" -name "*.so" -type f | while read file; do
echo "Found native library: $file"
for framework in netstandard2.1 net8.0 net10.0; do
target_dir="QRCoder.Core.Tests/bin/Release/$framework"
if [ -d "$target_dir" ]; then
cp "$file" "$target_dir/"
echo "Copied native library to $target_dir/"
fi
done
done
# List what we have in output directories
for framework in netstandard2.1 net8.0 net10.0; do
target_dir="QRCoder.Core.Tests/bin/Release/$framework"
if [ -d "$target_dir" ]; then
echo "=== Libraries in $target_dir ==="
ls -la "$target_dir/"*.so 2>/dev/null || echo "No .so files found"
fi
done

- name: Run Tests
env:
Expand Down
25 changes: 25 additions & 0 deletions QRCoder.Core.Tests/QRCoder.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,29 @@
<FrameworkReference Include="Microsoft.WindowsDesktop.App" />
</ItemGroup>

<!-- Copy native SkiaSharp libraries to output directory for all platforms -->
<ItemGroup>
<Content Include="$(NuGetPackageRoot)skiaSharp.nativeassets.linux\3.119.0\runtimes\linux-x64\native\*.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Pack>false</Pack>
<Condition>"$(TargetFramework)" == "netstandard2.1" or "$(TargetFramework)" == "net8.0" or "$(TargetFramework)" == "net10.0"</Condition>
</Content>
<Content Include="$(NuGetPackageRoot)skiaSharp.nativeassets.macos\3.119.0\runtimes\osx-x64\native\*.dylib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Pack>false</Pack>
<Condition>"$(TargetFramework)" == "netstandard2.1" or "$(TargetFramework)" == "net8.0" or "$(TargetFramework)" == "net10.0"</Condition>
</Content>
<Content Include="$(NuGetPackageRoot)skiaSharp.nativeassets.win32\3.119.0\runtimes\win-x64\native\*.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Pack>false</Pack>
<Condition>"$(TargetFramework)" == "netstandard2.1" or "$(TargetFramework)" == "net8.0" or "$(TargetFramework)" == "net10.0"</Condition>
</Content>
</ItemGroup>

<!-- Ensure SkiaSharp native libraries are available in CI -->
<PropertyGroup>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>


</Project>
Loading