Skip to content

Commit

Permalink
Merge pull request #501 from specklesystems/dev
Browse files Browse the repository at this point in the history
Update dev to release
  • Loading branch information
oguzhankoral authored Jan 16, 2025
2 parents 370588f + db4d2f7 commit 189ea3a
Show file tree
Hide file tree
Showing 315 changed files with 7,722 additions and 3,391 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ dotnet_diagnostic.ca1508.severity = warning # Avoid dead conditional code
dotnet_diagnostic.ca1509.severity = warning # Invalid entry in code metrics configuration file
dotnet_diagnostic.ca1861.severity = none # Prefer 'static readonly' fields over constant array arguments if the called method is called repeatedly and is not mutating the passed array (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1861)

# CA2007: Consider calling ConfigureAwait on the awaited task (this is not needed for application code, in fact we don't want to call anything but ConfigureAwait(true) which is the default)
dotnet_diagnostic.CA2007.severity = none

dotnet_diagnostic.cs8618.severity = suggestion # nullable problem


Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ jobs:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}

- name: ⚒️ Run build
- name: ⚒️ Run Build on Linux
run: ./build.sh build-linux

- name: ⚒️ Run tests
run: ./build.sh test-only

- name: Upload coverage reports to Codecov with GitHub Action
Expand Down
25 changes: 18 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
tags: ["v3.*"] # Manual delivery on every 3.x tag

jobs:
build:
build-windows:
runs-on: windows-latest
outputs:
version: ${{ steps.set-version.outputs.version }}
Expand All @@ -27,10 +27,10 @@ jobs:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}

- name: ⚒️ Run GitVersion
- name: ⚒️ Run GitVersion on Windows
run: ./build.ps1 build-server-version

- name: ⚒️ Run build
- name: ⚒️ Run build on Windows
run: ./build.ps1

- name: ⬆️ Upload artifacts
Expand All @@ -46,7 +46,7 @@ jobs:

deploy-installers:
runs-on: ubuntu-latest
needs: build
needs: build-windows
env:
IS_TAG_BUILD: ${{ github.ref_type == 'tag' }}
IS_RELEASE_BRANCH: ${{ startsWith(github.ref_name, 'release/') || github.ref_name == 'main'}}
Expand All @@ -58,7 +58,7 @@ jobs:
workflow: Build Installers
repo: specklesystems/connector-installers
token: ${{ secrets.CONNECTORS_GH_TOKEN }}
inputs: '{ "run_id": "${{ github.run_id }}", "version": "${{ needs.build.outputs.version }}", "public_release": ${{ env.IS_TAG_BUILD }}, "store_artifacts": ${{ env.IS_RELEASE_BRANCH }} }'
inputs: '{ "run_id": "${{ github.run_id }}", "version": "${{ needs.build-windows.outputs.version }}", "public_release": ${{ env.IS_TAG_BUILD }}, "store_artifacts": ${{ env.IS_RELEASE_BRANCH }} }'
ref: main
wait-for-completion: true
wait-for-completion-interval: 10s
Expand All @@ -70,11 +70,13 @@ jobs:
with:
name: output-*

test:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand All @@ -87,11 +89,20 @@ jobs:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}

- name: ⚒️ Run build
- name: ⚒️ Run GitVersion on Linux
run: ./build.sh build-server-version

- name: ⚒️ Run tests on Linux
run: ./build.sh test-only

- name: ⚒️ Run Build and Pack on Linux
run: ./build.sh build-linux

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v5
with:
file: Converters/**/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}

- name: Push to nuget.org
run: dotnet nuget push output/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{secrets.CONNECTORS_NUGET_TOKEN }} --skip-duplicate
4 changes: 2 additions & 2 deletions Build/Github.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public static async Task BuildInstallers(string token, string runId, string vers
Content = content
};
request.Headers.Add("X-GitHub-Api-Version", "2022-11-28");
var response = await client.SendAsync(request).ConfigureAwait(false);
var response = await client.SendAsync(request);
if (!response.IsSuccessStatusCode)
{
throw new InvalidOperationException(
$"{response.StatusCode} {response.ReasonPhrase} {await response.Content.ReadAsStringAsync().ConfigureAwait(false)}"
$"{response.StatusCode} {response.ReasonPhrase} {await response.Content.ReadAsStringAsync()}"
);
}
}
Expand Down
25 changes: 24 additions & 1 deletion Build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
const string CLEAN = "clean";
const string RESTORE = "restore";
const string BUILD = "build";
const string BUILD_LINUX = "build-linux";
const string TEST = "test";
const string TEST_ONLY = "test-only";
const string FORMAT = "format";
Expand Down Expand Up @@ -98,7 +99,7 @@ void RemoveDirectory(string d)
VERSION,
async () =>
{
var (output, _) = await ReadAsync("dotnet", "minver -v w").ConfigureAwait(false);
var (output, _) = await ReadAsync("dotnet", "minver -v w");
output = output.Trim();
Console.WriteLine($"Version: {output}");
Run("echo", $"\"version={output}\" >> $GITHUB_OUTPUT");
Expand Down Expand Up @@ -183,6 +184,28 @@ void RemoveDirectory(string d)
}
);

Target(
BUILD_LINUX,
DependsOn(FORMAT),
Glob.Files(".", "**/Speckle.Importers.Ifc.csproj"),
file =>
{
Run("dotnet", $"restore {file} --locked-mode");
var version = Environment.GetEnvironmentVariable("GitVersion_FullSemVer") ?? "3.0.0-localBuild";
var fileVersion = Environment.GetEnvironmentVariable("GitVersion_AssemblySemFileVer") ?? "3.0.0.0";
Console.WriteLine($"Version: {version} & {fileVersion}");
Run(
"dotnet",
$"build {file} -c Release --no-restore -warnaserror -p:Version={version} -p:FileVersion={fileVersion} -v:m"
);

RunAsync(
"dotnet",
$"pack {file} -c Release -o output --no-build -p:Version={version} -p:FileVersion={fileVersion} -v:m"
);
}
);

Target(
ZIP,
DependsOn(TEST),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,14 @@ public async Task Receive(string modelCardId)
modelCard.GetReceiveInfo("ArcGIS"), // POC: get host app name from settings? same for GetSendInfo
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationToken),
cancellationToken
)
.ConfigureAwait(false);
);

modelCard.BakedObjectIds = receiveOperationResults.BakedObjectIds.ToList();
await Commands
.SetModelReceiveResult(
modelCardId,
receiveOperationResults.BakedObjectIds,
receiveOperationResults.ConversionResults
)
.ConfigureAwait(false);
await Commands.SetModelReceiveResult(
modelCardId,
receiveOperationResults.BakedObjectIds,
receiveOperationResults.ConversionResults
);
}
catch (OperationCanceledException)
{
Expand All @@ -100,7 +97,7 @@ await Commands
catch (Exception ex) when (!ex.IsFatal()) // UX reasons - we will report operation exceptions as model card error. We may change this later when we have more exception documentation
{
_logger.LogModelCardHandledError(ex);
await Commands.SetModelError(modelCardId, ex).ConfigureAwait(false);
await Commands.SetModelError(modelCardId, ex);
}
}

Expand Down
Loading

0 comments on commit 189ea3a

Please sign in to comment.