Compare commits
7 Commits
0.0.0-alpha
..
0.0.5
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ec42cde84 | |||
| 86e4759531 | |||
| e3806f3fb4 | |||
| 591ff49340 | |||
| b1872be922 | |||
| aff5834508 | |||
| 2eccfafe45 |
@@ -21,7 +21,7 @@ jobs:
|
||||
run: dotnet restore
|
||||
- name: Extract functionInputSchema
|
||||
id: extract_schema
|
||||
working-directory: "SpeckleRegressionTester"
|
||||
working-directory: "SpeckleAutomateDotnetExample"
|
||||
run: |
|
||||
dotnet build
|
||||
dotnet run generate-schema ${HOME}/functionSchema.json
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
- name: Speckle Automate Function - Build and Publish
|
||||
uses: specklesystems/speckle-automate-github-composite-action@0.7.2
|
||||
with:
|
||||
speckle_function_command: "dotnet SpeckleRegressionTester.dll"
|
||||
speckle_function_command: "dotnet SpeckleAutomateDotnetExample.dll"
|
||||
speckle_automate_url: ${{ env.SPECKLE_AUTOMATE_URL }}
|
||||
speckle_token: ${{ secrets.SPECKLE_FUNCTION_TOKEN }}
|
||||
speckle_function_id: ${{ secrets.SPECKLE_FUNCTION_ID }}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0 as build-env
|
||||
|
||||
WORKDIR /src
|
||||
COPY SpeckleRegressionTester/ .
|
||||
COPY SpeckleAutomateDotnetExample/ .
|
||||
RUN dotnet restore --use-current-runtime
|
||||
RUN dotnet publish --use-current-runtime --self-contained false --no-restore -o /publish
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.002.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpeckleRegressionTester", "SpeckleAutomateDotnetExample\SpeckleRegressionTester.csproj", "{E1DE5809-1111-4817-9B7D-7ADCA087FA1C}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpeckleAutomateDotnetExample", "SpeckleAutomateDotnetExample\SpeckleAutomateDotnetExample.csproj", "{E1DE5809-1111-4817-9B7D-7ADCA087FA1C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -2,6 +2,7 @@ using Objects;
|
||||
using Speckle.Automate.Sdk;
|
||||
using Speckle.Automate.Sdk.Schema;
|
||||
using Speckle.Core.Api;
|
||||
using Speckle.Core.Credentials;
|
||||
using Speckle.Core.Models;
|
||||
using Speckle.Core.Models.Extensions;
|
||||
using Speckle.Core.Transports;
|
||||
@@ -37,6 +38,8 @@ static class AutomateFunction
|
||||
throw new Exception("Release branch has no commits");
|
||||
}
|
||||
|
||||
var tolerance = functionInputs.Tolerance;
|
||||
|
||||
Console.WriteLine($"Comparing {testBranchName} against {releaseBranchName}");
|
||||
|
||||
// get the test and release commits
|
||||
@@ -44,19 +47,25 @@ static class AutomateFunction
|
||||
Base? testingCommitObject = await automationContext.ReceiveVersion();
|
||||
Console.WriteLine("Received test version: " + testingCommitObject);
|
||||
Console.WriteLine("Receiving release version");
|
||||
using ServerTransport transport =
|
||||
new(
|
||||
automationContext.SpeckleClient.Account,
|
||||
automationContext.AutomationRunData.ProjectId
|
||||
);
|
||||
ServerTransport serverTransport = new ServerTransport(
|
||||
automationContext.SpeckleClient.Account,
|
||||
automationContext.AutomationRunData.ProjectId
|
||||
);
|
||||
Base? releaseCommitObject = await Operations
|
||||
.Receive(releaseCommit.referencedObject, transport)
|
||||
.Receive(
|
||||
(
|
||||
await automationContext.SpeckleClient
|
||||
.CommitGet(automationContext.AutomationRunData.ProjectId, releaseCommit.id)
|
||||
.ConfigureAwait(continueOnCapturedContext: false)
|
||||
).referencedObject,
|
||||
serverTransport,
|
||||
new MemoryTransport()
|
||||
)
|
||||
.ConfigureAwait(continueOnCapturedContext: false);
|
||||
if (releaseCommitObject == null)
|
||||
{
|
||||
throw new Exception("Commit root object was null");
|
||||
}
|
||||
|
||||
Console.WriteLine("Received release version: " + releaseCommitObject);
|
||||
|
||||
// flatten both commits
|
||||
@@ -65,7 +74,10 @@ static class AutomateFunction
|
||||
var releaseCommitObjectsDict = new Dictionary<string, Base>();
|
||||
foreach (var releaseObject in releaseCommitObjects)
|
||||
{
|
||||
if (!releaseCommitObjectsDict.ContainsKey(releaseObject.applicationId))
|
||||
if (
|
||||
releaseObject.applicationId != null
|
||||
&& !releaseCommitObjectsDict.ContainsKey(releaseObject.applicationId)
|
||||
)
|
||||
{
|
||||
releaseCommitObjectsDict.Add(releaseObject.applicationId, releaseObject);
|
||||
}
|
||||
@@ -82,7 +94,10 @@ static class AutomateFunction
|
||||
int unchangedCount = 0;
|
||||
foreach (Base testObject in testCommitObjects)
|
||||
{
|
||||
if (releaseCommitObjectsDict.ContainsKey(testObject.applicationId))
|
||||
if (
|
||||
testObject.applicationId != null
|
||||
&& releaseCommitObjectsDict.ContainsKey(testObject.applicationId)
|
||||
)
|
||||
{
|
||||
Base releaseObject = releaseCommitObjectsDict[testObject.applicationId];
|
||||
|
||||
@@ -96,8 +111,9 @@ static class AutomateFunction
|
||||
{
|
||||
modifiedCount++;
|
||||
var diffDictionary = new Dictionary<string, string>();
|
||||
Dictionary<string, object> releaseObjectPropDict = releaseObject.GetMembers();
|
||||
Dictionary<string, object> testObjectPropDict = testObject.GetMembers();
|
||||
Dictionary<string, object?> releaseObjectPropDict =
|
||||
releaseObject.GetMembers();
|
||||
Dictionary<string, object?> testObjectPropDict = testObject.GetMembers();
|
||||
foreach (var entry in testObjectPropDict)
|
||||
{
|
||||
if (releaseObjectPropDict.ContainsKey(entry.Key))
|
||||
|
||||
@@ -7,8 +7,8 @@ using System.ComponentModel.DataAnnotations;
|
||||
/// are valid and match the required schema.
|
||||
struct FunctionInputs
|
||||
{
|
||||
//[Required]
|
||||
//public double Tolerance;
|
||||
[Required]
|
||||
public double Tolerance;
|
||||
|
||||
//public string Exclusions;
|
||||
}
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Speckle.Automate.Sdk" Version="2.17.0-automate3" />
|
||||
<PackageReference Include="Speckle.Objects" Version="2.17.0-automate3" />
|
||||
<PackageReference Include="Speckle.Automate.Sdk" Version="2.18.0-fileInput" />
|
||||
<PackageReference Include="Speckle.Objects" Version="2.18.0-fileInput" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user