Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
35e8123
Added native test tool
Danielku15 Oct 14, 2023
1133a11
Setup library tests
Danielku15 Oct 15, 2023
65ede51
Adjust used exceptions
Danielku15 Oct 15, 2023
00f341d
Remove exceptions
Danielku15 Oct 15, 2023
b37e5cd
Add include for int types
Danielku15 Oct 15, 2023
9aa9458
Avoid duplicate target execution
Danielku15 Oct 15, 2023
ddbc082
Make linux dependency install a target
Danielku15 Oct 15, 2023
798d058
Remove exception handling
Danielku15 Oct 15, 2023
447d1d6
Add msising condition for dependency install
Danielku15 Oct 15, 2023
47a66ab
Adjust some compilation settings
Danielku15 Oct 15, 2023
78cbfdb
Only build tests for shared variants
Danielku15 Oct 15, 2023
1b9ff80
Remove test outputs
Danielku15 Oct 15, 2023
676f376
Mark root as found
Danielku15 Oct 15, 2023
0170807
Set min macOS version
Danielku15 Oct 15, 2023
a24f50c
Update reference test checks
Danielku15 Oct 15, 2023
5ff74d2
Set macOS version only for macOS target OS compilation
Danielku15 Oct 15, 2023
0935d48
Patch macOS version target in skia build config
Danielku15 Oct 15, 2023
71f8c4a
Add old file writing for comparison
Danielku15 Oct 15, 2023
474ba0a
Add macOS test output as reference
Danielku15 Oct 15, 2023
4dc80f2
Alternative image loading hoping for deterministic pixels on linux
Danielku15 Oct 15, 2023
5c50dc7
GHA test fixes
Danielku15 Oct 15, 2023
20c8c1c
Fix some folder structure issues
Danielku15 Oct 15, 2023
fd2ed34
More adaptions for tests
Danielku15 Oct 15, 2023
fe30f3d
Reorganize artifacts
Danielku15 Oct 21, 2023
84a74b7
Use single quotes
Danielku15 Oct 21, 2023
e633e89
Handle dynamic changes
Danielku15 Oct 21, 2023
0d89731
Alternative syntax
Danielku15 Oct 21, 2023
356f80c
More logs
Danielku15 Oct 21, 2023
57e1861
More modification while iteration handling
Danielku15 Oct 21, 2023
7519251
Missing pipe
Danielku15 Oct 21, 2023
bda1ddb
Add targets
Danielku15 Oct 21, 2023
c004301
More test fixe
Danielku15 Oct 22, 2023
1dd237e
Further test adaptions
Danielku15 Oct 22, 2023
5d30409
Set java compiler encoding
Danielku15 Oct 22, 2023
1c15e9c
Correct Maven folder casing
Danielku15 Oct 23, 2023
83b0742
Avoid clearing of env-vars
Danielku15 Oct 23, 2023
3aab266
Use lowercase folders to avoid conflicts
Danielku15 Oct 23, 2023
8e92c71
Add java setup
Danielku15 Oct 24, 2023
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
16 changes: 13 additions & 3 deletions .github/actions/build-alphaskia/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:
steps:
- uses: actions/download-artifact@v3
with:
path: dist
path: dist/.organize/libskia-${{ inputs.target-os }}-${{ inputs.architecture }}-static
name: libskia-${{ inputs.target-os }}-${{ inputs.architecture }}-static

- id: build-info
Expand All @@ -34,10 +34,20 @@ runs:
fi
shell: bash

- run: ${{ steps.build-info.outputs.script }} LibAlphaSkia --target-os ${{ inputs.target-os }} --architecture ${{ inputs.architecture }} --variant ${{ inputs.variant }}
- run: ${{ steps.build-info.outputs.script }} LibAlphaSkia LibAlphaSkiaTest --target-os ${{ inputs.target-os }} --architecture ${{ inputs.architecture }} --variant ${{ inputs.variant }}
shell: ${{ steps.build-info.outputs.shell }}

- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: libalphaskia-${{ inputs.target-os }}-${{ inputs.architecture }}-${{ inputs.variant }}
path: artifacts
path: artifacts

- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: libalphaskiatest-${{ inputs.target-os }}-${{ inputs.architecture }}-${{ inputs.variant }}
if-no-files-found: ignore
path: |
dist/libalphaskiatest-${{ inputs.target-os }}-${{ inputs.architecture }}-${{ inputs.variant }}/
test/test-outputs/
2 changes: 2 additions & 0 deletions .github/actions/build-skia/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ runs:
shell: bash

- run: ${{ steps.build-info.outputs.script }} LibSkiaWithCache --target-os ${{ inputs.target-os }} --architecture ${{ inputs.architecture }} --use-cache ${{ inputs.use-cache }}
id: build
shell: ${{ steps.build-info.outputs.shell }}

- uses: actions/upload-artifact@v3
Expand All @@ -42,6 +43,7 @@ runs:
path: artifacts

- uses: actions/cache/save@v3
if: ${{ steps.build.outputs.build-skipped != 'true' }}
with:
path: dist
key: libskia-${{ inputs.target-os }}-${{ inputs.architecture }}-static-${{ github.run_id }}
93 changes: 85 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,40 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: dist
path: dist/.organize
- run: ./build.cmd DotNet
- uses: actions/upload-artifact@v3
with:
name: Nupkgs
name: nupkgs
path: |
lib/dotnet/**/bin/Release/*.nupkg
lib/dotnet/**/bin/Release/*.snupkg
lib/dotnet/**/*.nupkg
dotnet-test:
strategy:
fail-fast: false
matrix:
include:
- runs-on: ubuntu-latest
architecture: x64
- runs-on: windows-latest
architecture: x64
- runs-on: windows-latest
architecture: x86
- runs-on: macos-latest
architecture: x64
runs-on: ${{ matrix.runs-on }}
needs: [dotnet]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: nupkgs
path: dist/.organize/nupkgs
- run: ./build.cmd DotNetTest --architecture ${{ matrix.architecture }}
- uses: actions/upload-artifact@v3
with:
name: DotNet Test Results
path: |
test/test-outputs/**/*.*

java:
runs-on: ubuntu-latest
Expand All @@ -214,13 +240,40 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: dist
path: dist/.organize
- run: ./build.cmd Java
- uses: actions/upload-artifact@v3
with:
name: Maven
name: maven
path: |
lib/java/dist/**/*.*
java-test:
strategy:
fail-fast: false
matrix:
include:
- runs-on: ubuntu-latest
- runs-on: windows-latest
- runs-on: macos-latest
runs-on: ${{ matrix.runs-on }}
needs: [java]
steps:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: maven
path: dist/.organize/maven
- run: ./build.cmd JavaTest
- uses: actions/upload-artifact@v3
with:
name: Java Test Results
path: |
test/test-outputs/**/*.*


node:
runs-on: ubuntu-latest
Expand All @@ -229,10 +282,34 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: dist
path: dist/.organize
- run: ./build.cmd Node
- uses: actions/upload-artifact@v3
with:
name: NodeTars
name: nodetars
path: |
lib/node/*/*.tgz
node-test:
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, windows-latest, macos-latest]
node: [latest, "lts/*"]
runs-on: ${{ matrix.runs-on }}
needs: [node]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: nodetars
path: dist/.organize/node
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: node -e "console.log(process)"
- run: ./build.cmd NodeTest
- uses: actions/upload-artifact@v3
with:
name: Node Test Results
path: |
test/test-outputs/**/*.*
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -718,4 +718,5 @@ fabric.properties
/lib/java/local.properties
/lib/node/**/test-outputs
/lib/node/*/*.tgz
/lib/dotnet/Version.props
/lib/dotnet/Version.props
/test/test-outputs
6 changes: 6 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,15 @@
"DotNetBuild",
"DotNetPack",
"DotNetTest",
"InstallDependenciesLinux",
"Java",
"JavaBuild",
"JavaPack",
"JavaTest",
"LibAlphaSkia",
"LibAlphaSkiaGitSyncDeps",
"LibAlphaSkiaPatchSkiaBuildFiles",
"LibAlphaSkiaTest",
"LibSkia",
"LibSkiaGitSyncDeps",
"LibSkiaPatchSkiaBuildFiles",
Expand All @@ -151,12 +154,15 @@
"DotNetBuild",
"DotNetPack",
"DotNetTest",
"InstallDependenciesLinux",
"Java",
"JavaBuild",
"JavaPack",
"JavaTest",
"LibAlphaSkia",
"LibAlphaSkiaGitSyncDeps",
"LibAlphaSkiaPatchSkiaBuildFiles",
"LibAlphaSkiaTest",
"LibSkia",
"LibSkiaGitSyncDeps",
"LibSkiaPatchSkiaBuildFiles",
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,6 @@
"scoped_allocator": "cpp",
"typeindex": "cpp",
"__std_stream": "cpp",
"barrier": "cpp"
}
}
1 change: 1 addition & 0 deletions build/.idea/.idea.build.dir/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 23 additions & 1 deletion build/Architecture.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.ComponentModel;
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Nuke.Common.Tooling;

[TypeConverter(typeof(TypeConverter<Architecture>))]
Expand All @@ -25,6 +27,26 @@ public class Architecture : Enumeration
LinuxCrossTargetArch = "aarch64-linux-gnu"
};

public static Architecture Current
{
get
{
switch (RuntimeInformation.OSArchitecture)
{
case System.Runtime.InteropServices.Architecture.X86:
return X86;
case System.Runtime.InteropServices.Architecture.X64:
return X64;
case System.Runtime.InteropServices.Architecture.Arm:
return Arm;
case System.Runtime.InteropServices.Architecture.Arm64:
return Arm64;
default:
throw new PlatformNotSupportedException("Building on this platform is not fully supported");
}
}
}

public string LinuxArch { get; private set; }
public string LinuxCrossToolchain { get; private set; }
public string LinuxCrossTargetArch { get; private set; }
Expand Down
56 changes: 42 additions & 14 deletions build/Build.DotNet.cs
Original file line number Diff line number Diff line change
@@ -1,40 +1,56 @@
using System;
using Nuke.Common;
using Nuke.Common.IO;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using Serilog;

partial class Build
{
public Target DotNet => _ => _
.DependsOn(DotNetPack);

public Target DotNetPack => _ => _
.Unlisted()
.DependsOn(DotNetTest)
.Executes(() =>
{
DotNetTasks.DotNetPack(_ => _
.SetProcessWorkingDirectory(RootDirectory / "lib" / "dotnet")
.SetConfiguration("Release")
);
});
public Target DotNetTest => _ => _
.Unlisted()
.DependsOn(DotNetBuild)
.Executes(() =>
{
DotNetTasks.DotNetTest(_ => _
if (Rebuild)
{
(TemporaryDirectory / "packages").DeleteDirectory();
(RootDirectory / "lib" / "dotnet")
.GetFiles("*.nupkg", int.MaxValue)
.DeleteFiles();
}

DotNetTasks.DotNetPack(_ => _
.SetProcessWorkingDirectory(RootDirectory / "lib" / "dotnet")
.SetConfiguration("Release")
);

if (IsLocalBuild)
{
if (Rebuild)
{
(RootDirectory / "dist" / "nupkgs").DeleteDirectory();
}

foreach (var nupkg in (RootDirectory / "lib" / "dotnet").GetFiles("*.nupkg", int.MaxValue))
{
FileSystemTasks.CopyFile(nupkg,
RootDirectory / "dist" / "nupkgs" / nupkg.Name,
FileExistsPolicy.OverwriteIfNewer);
}
}
});

public Target DotNetBuild => _ => _
.Unlisted()
.DependsOn(PrepareGitHubArtifacts)
.Executes(() =>
{
DotNetWriteVersionInfoProps();

DotNetTasks.DotNetBuild(_ => _
.SetProcessWorkingDirectory(RootDirectory / "lib" / "dotnet")
.SetConfiguration("Release")
Expand All @@ -57,7 +73,7 @@ void DotNetWriteVersionInfoProps()
{
semVer = $"{VersionInfo.FileVersion.ToString(3)}";
}

var props = $"""
<Project>
<PropertyGroup>
Expand All @@ -78,4 +94,16 @@ void DotNetWriteVersionInfoProps()
""";
(RootDirectory / "lib" / "dotnet" / "Version.props").WriteAllText(props);
}

public Target DotNetTest => _ => _
.DependsOn(PrepareGitHubArtifacts)
.Executes(() =>
{
DotNetTasks.DotNetRun(_ => _
.SetProcessWorkingDirectory(RootDirectory / "test" / "dotnet" / "AlphaSkia.Test")
.SetRuntime(TargetOperatingSystem.Current.DotNetRid + "-" +
(Architecture ?? Architecture.Current))
.AddProcessEnvironmentVariable("NUGET_PACKAGES", TemporaryDirectory / "packages")
);
});
}
Loading