From bbfd8e5a543f15a7bdcd0bf8391068b5c74b3fac Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Thu, 20 Jun 2024 17:34:33 -0400 Subject: [PATCH] Add .NET 9 to CI Test the in-development .NET 9 RPM as a way to find out how well dotnet-regular-tests are working against .NET 9. Also update templates-test to support a new set of templates that require an existing project before `dotnet new $template` will work. This includes a template new to .NET 9 (mstest-class) but also a template that didn't behave this way in .NET 8 (nunit-test). Also update tools-in-path to be more flexible with versions during preview/rc release phase. Also fix distribution-packages to find/use the ASP.NET Core version correctly. --- .github/workflows/ci.yml | 7 +++++++ distribution-packages/test.sh | 4 +++- template-test/test.sh | 29 ++++++++++++++++++++++++++--- tools-in-path/test.sh | 8 +++++++- 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb3dcdd..8643b49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,9 @@ jobs: dotnet_version: - "6.0" - "8.0" + include: + - container_image: registry.fedoraproject.org/fedora:40 + dotnet_version: "9.0" container: image: ${{ matrix.container_image }} @@ -44,6 +47,10 @@ jobs: set -euo pipefail cat /etc/os-release if grep fedora /etc/os-release ; then + if [[ ${{ matrix.dotnet_version }} == 9.* ]]; then + dnf install 'dnf-command(copr)' -y + dnf copr enable @dotnet-sig/dotnet-preview -y + fi dnf install -y dotnet-sdk-${{ matrix.dotnet_version }} if [[ ! ${{ matrix.dotnet_version }} == *6* ]]; then dnf install -y \ diff --git a/distribution-packages/test.sh b/distribution-packages/test.sh index 1a1fd1a..24f55bd 100755 --- a/distribution-packages/test.sh +++ b/distribution-packages/test.sh @@ -6,12 +6,14 @@ set -x sdk_version="$(dotnet --version)" runtime_version="$(dotnet --list-runtimes | grep Microsoft.NETCore.App | awk '{ print $2 }')" +aspnetcore_runtime_version="$(dotnet --list-runtimes | grep Microsoft.AspNetCore.App | awk '{ print $2 }')" runtime_id=$(../runtime-id) # This might be the final/only netstandard version from now on netstandard_version=2.1 ./test-standard-packages \ "${runtime_id}" \ - "${runtime_version}" "${runtime_version}" \ + "${runtime_version}" \ + "${aspnetcore_runtime_version}" \ "${sdk_version}" \ "${netstandard_version}" diff --git a/template-test/test.sh b/template-test/test.sh index 9e7a6ec..fc8440f 100755 --- a/template-test/test.sh +++ b/template-test/test.sh @@ -7,6 +7,10 @@ set -euo pipefail IFS=$'\n\t' set -x +IFS='.-' read -ra VERSION_SPLIT <<< "$1" +declare -a allTemplates +major_version="${VERSION_SPLIT[0]}" + # The list of templates in each version of .NET that we want to test. # If additional templates are found via `dotnet new --list`, this test # will fail unless they are added here. @@ -210,6 +214,7 @@ dotnet3Templates=( # format: