Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix broken ci components #51

Merged
merged 9 commits into from
Oct 5, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:

- name: Format
working-directory: ./src
run: dotnet format --verify-no-changes
run: dotnet format --verify-no-changes --no-restore
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding --no-restore fixes a runtime issue. The parameter:

Doesn't execute an implicit restore before formatting. Default is to do implicit restore.


12 changes: 11 additions & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,24 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: windows-latest
Copy link
Contributor Author

@miquelbeltran miquelbeltran Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching to windows image so we can test MAUI build for Android, Windows, iOS and macOS

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does a Windows image (and Ubuntu before, too) build for iOS and macOS?


steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: '17'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
Comment on lines +23 to +29
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setup Android build requirements

- name: Restore workloads
working-directory: ./src
run: dotnet workload restore
Comment on lines +30 to +32
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installs MAUI workloads

- name: Restore dependencies
working-directory: ./src
run: dotnet restore
Expand Down
4 changes: 2 additions & 2 deletions src/Raygun.Blazor.Maui/Control/RaygunErrorBoundary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public class RaygunErrorBoundary : ErrorBoundary
///
/// </summary>
[Inject]
internal RaygunBlazorClient RaygunClient { get; set; }
required public RaygunBlazorClient RaygunClient { get; set; }

/// <summary>
///
/// </summary>
[Inject]
internal IOptions<RaygunSettings> RaygunSettings { get; set; }
required public IOptions<RaygunSettings> RaygunSettings { get; set; }

#endregion

Expand Down
6 changes: 4 additions & 2 deletions src/Raygun.Blazor.Maui/Raygun.Blazor.Maui.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks>net8.0-android</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">
$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
$(TargetFrameworks);net8.0-ios;net8.0-maccatalyst;net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('osx'))">
$(TargetFrameworks);net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
Comment on lines +4 to +8
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the platform is Windows, it builds for Windows, Android, Mac and iOS. When the platform is osx (macos) it builds for Android, iOS and Mac. On the rest of platforms (basically Linux) it only builds for Android.

Same for the Sample project.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this answers my question above.

<!-- Uncomment to also build the tizen app. You will need to install tizen by following
this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public TimerBasedSendStrategy(TimeSpan? interval = null)
Start();
}

/// <summary>
/// Class destructor. Disposes the timer.
/// </summary>
~TimerBasedSendStrategy()
{
Dispose();
Expand Down
4 changes: 2 additions & 2 deletions src/Raygun.Samples.Blazor.Maui/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public static MauiApp CreateMauiApp()
builder.Services.AddMauiBlazorWebView();

#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
Comment on lines +32 to +33
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes formatting

#endif

return builder.Build();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0-android</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">
$(TargetFrameworks);net8.0-ios;net8.0-maccatalyst;net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('osx'))">
$(TargetFrameworks);net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->

Expand Down