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

ci: fix broken ci components #51

merged 9 commits into from
Oct 5, 2024

Conversation

miquelbeltran
Copy link
Contributor

@miquelbeltran miquelbeltran commented Oct 1, 2024

ci: fix broken ci components

Description 📝

  • Purpose: Currently some of the CI jobs won't run, attempt to fix them
  • Approach: Changes in GitHub CI files and formatting

Type of change'

  • Bug fix (non-breaking change which fixes an issue)

Updates

  • Fixes the existing CI build to be compatible with MAUI. See comments for details.

Test plan 🧪

  • CI should be all passing

Author to check 👓

  • Project and all contained modules builds successfully
  • Self-/dev-tested
  • Unit/UI/Automation/Integration tests provided where applicable
  • Code is written to standards
  • Appropriate documentation written (code comments, internal docs)

Reviewer to check ✔️

  • Project and all contained modules builds successfully
  • Change has been dev-/reviewer-tested, where possible
  • Unit/UI/Automation/Integration tests provided where applicable
  • Code is written to standards
  • Appropriate documentation written (code comments, internal docs)

@@ -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,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?

Comment on lines +23 to +29
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: '17'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
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

Comment on lines +30 to +32
- name: Restore workloads
working-directory: ./src
run: dotnet workload 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.

Installs MAUI workloads

Comment on lines +4 to +8
<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>
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.

Comment on lines +32 to +33
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
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

@miquelbeltran miquelbeltran marked this pull request as ready for review October 1, 2024 12:34
@miquelbeltran miquelbeltran requested review from TheRealAgentK, a team, PanosNB and sumitramanga and removed request for a team October 1, 2024 12:36
@sumitramanga
Copy link
Collaborator

When viewing the Files Changed tab, there are some warnings to address, could you perhaps look into those. Or, if they're an Issue already, I'm happy with them being in a separate branch,

@miquelbeltran
Copy link
Contributor Author

I'll address them in this branch @sumitramanga

@miquelbeltran
Copy link
Contributor Author

@sumitramanga the warnings have been addressed now

@miquelbeltran miquelbeltran mentioned this pull request Oct 2, 2024
11 tasks
@@ -12,14 +12,24 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: windows-latest
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?

Comment on lines +4 to +8
<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>
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.

@miquelbeltran
Copy link
Contributor Author

Yep, I tried to make it work on Ubuntu but compiling on Linux only works for Android MAUI apps (and only from CLI, not even in Rider). Windows VMs seem the best compromise as it can build for all 4 platforms.

@miquelbeltran miquelbeltran merged commit 94d0e36 into main Oct 5, 2024
3 checks passed
@miquelbeltran miquelbeltran deleted the fix-ci branch October 5, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants