From 684f2fa1354abc50748095861d8244de656c71a2 Mon Sep 17 00:00:00 2001 From: Jimmy Byrd Date: Sat, 16 Nov 2024 12:04:04 -0500 Subject: [PATCH] use configuration properly --- .github/workflows/build.yml | 10 +++------- build/Program.fs | 8 +++++++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index caaaa58..09a38fc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,8 +10,6 @@ jobs: build: strategy: matrix: - # Builds for Debug and Release configurations - configuration: [Debug, Release] # Builds for Ubuntu, Windows, and macOS os: [ubuntu-latest, windows-latest, macOS-latest] fail-fast: false @@ -20,14 +18,11 @@ jobs: steps: - uses: actions/checkout@v3 - # setup .NET per the repo global.json - - name: Setup .NET - uses: actions/setup-dotnet@v4 - - # setup .NET per test session + # setup .NET SDK - name: Setup .NET uses: actions/setup-dotnet@v4 with: + global-json-file: 'global.json' dotnet-version: | 8.x 9.x @@ -41,6 +36,7 @@ jobs: - name: Run build and test run: dotnet run --project build + env: - name: Archive test results uses: actions/upload-artifact@v3 diff --git a/build/Program.fs b/build/Program.fs index 4b54f9f..68ee155 100644 --- a/build/Program.fs +++ b/build/Program.fs @@ -32,9 +32,14 @@ let initializeContext args = let getBuildParam = Environment.environVar let DoNothing = ignore + let init args = initializeContext args + let configuration = + match getBuildParam "CONFIGURATION" with + | s when not (isNullOrWhiteSpace s) -> s + | _ -> "Release" let ignoreTests = match @@ -60,6 +65,7 @@ let init args = opts.MSBuildParams with DisableInternalBinLog = true } + Configuration = DotNet.BuildConfiguration.fromString configuration } Target.create "Build" (fun _ -> DotNet.build buildOpts "") @@ -82,7 +88,7 @@ let init args = exec "dotnet" - $"test --blame --blame-hang-timeout 60s --framework {tfm} --logger trx --logger GitHubActions -c Release .\\Ionide.ProjInfo.Tests\\Ionide.ProjInfo.Tests.fsproj" + $"test --blame --blame-hang-timeout 60s --framework {tfm} --logger trx --logger GitHubActions -c {configuration} .\\Ionide.ProjInfo.Tests\\Ionide.ProjInfo.Tests.fsproj" "test" (Map.ofSeq [ "BuildNet9", tfmToBuildNet9Map.[tfm].ToString() ]) |> ignore