The Mac pool we use `internal-macos12` is no longer available. Ideally we could just use the public Azure Pipelines pool, but those machines are underpowered and doubles the (already long!) time taken to build our packages. Switch to the internal `VSEng-VSMac-Xamarin-Shared` mac pool already in use by `dotnet/android` and MAUI.
`JavaToolInstaller@0` does not seem to work on this image, even though there are many versions of Java SDK already installed on the image. Set `JAVA_HOME` to Java SDK 11 so we can build.
Additionally, the `tools-executive-oreder-csv-and-markdown` Cake task does not work on these images because it expects `gradle` and other tools to be available in the `$PATH` which they aren't. As we do not consume or ship these files from the build, add a try/catch block to the task so that it does not fail the build if it fails.
We waited too late to ensure that this repository builds successfully on .NET 9, causing last-minute fixes in `generator`. This is something we need to be doing throughout the entire preview cycle, even though we do not ship packages targeting the preview framework.
This PR creates a CI option that can be requested which will run the repository on the preview version of .NET N+1.
Once this test succeeds (hopefully with .NET 9 RTM!) we can enable it as a nightly test to ensure we are continuously testing our .NET previews instead of waiting until the end of the preview cycle.
- Add `"skipExtendedTests"` to `config.json`. When set to `true`, the "extended" tests are not run for this package. This allows us to get our test job green with the packages that currently work. This way we can go ahead and have it running for currently working packages to ensure they do not regress.
- Set up a "nightly" job that will run the "extended" test suite every night. Note that this will only run if there have been changes to `main` since the previous run, so it generally won't actually run every night.
Today, when preparing a publish release, the "Sign Archive" step always fails the first run, as it relies on the output from the "Build Windows" job, but does not specify the dependency, so it runs before the packages have been built.
Specifying the dependency is better, but it makes the "Build Windows" stage take a lot longer and the test stage(s) cannot run until it completes.
This PR moves the signing to its own stage with the proper dependency set, so it will not run until the packages are ready. By moving it to its own stage it can also run in parallel with the test stage(s), reducing the overall CI time.
Convert our existing `BuildAllDotNet`/`BuildAllMauiApp` samples to NUnit based unit tests. These tests use `dotnet new android|maui` instead of committed projects so that we always ensure we are testing against the current templates that our users will be using.
Additionally, move these tests to another stage, so they can run in parallel with other [test suite(s)](https://github.com/xamarin/AndroidX/pull/892).
This PR does not remove the existing `BuildAll*` samples, those will be removed in a future PR.
Our current `BuildAllDotNet` and `BuidAllMauiApp` tests provide a smoke test that we are able to compile an application that consumes *all* of the packages from this repository *simultaneously*. However, this doesn't surface dependency errors that a user would see if they add *individual* packages to their application, which is the way packages are actually consumed.
This PR provides extended tests that do the following for each individual package:
- Create a new `android`/`maui` template app
- Add one package to the app
- Compile the app
Even though we parallelize the tests across many test agents, this involves compiling over 600 applications, so the tests take a long time to run and cannot be run on every commit. For now, we will start with this being a manually run CI test that can be kicked off in the CI UI by setting the `Run Extended Tests?` parameter to `true`.
Note that there are currently packages that fail this test. Our goal will be to fix these in future changes.
With support for Classic Xamarin.Android [ended May 1st, 2024](https://dotnet.microsoft.com/en-us/platform/support/policy/xamarin), we can start removing all the hacks needed to support both Classic and .NET for Android.
- No longer build EOL frameworks: `MonoAndroid12.0;net6.0-android;`
- No longer need to install classic XA
- No longer need to have classic XA or XF sample builds
- No longer need to use `Xamarin.Legacy.Sdk`
For this PR, we'll only build `net7.0-android`. A future PR should enable `net8.0-android`.
The best news: with this our CI build time drops from ~80 minutes to ~35 minutes. 🎉
As part of Microsoft's continued push for supply chain security, our CI that builds shipping software must extend an "official" template that can be used to ensure various safety checks have run.
Unfortunately, this requires extensive changes to our CI to fit their model. This PR requires both necessary changes and cleanup done to make our process mesh better with the template.
The only functional difference should be:
- Previously the outputs of both the `Windows` and `MacOS` builds were copied to the same artifact directory (`"nuget"`) which was signed and released. This meant that the last one written "won" and that's what we shipped. The new template didn't like multiple agents writing to the same output directory, so now we only write to `output-windows` and `output-macos`, and we always sign and ship the `output-windows` output.