Skip to content

Commit

Permalink
use configuration properly
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAngryByrd committed Nov 16, 2024
1 parent 460b8dd commit 684f2fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
8 changes: 7 additions & 1 deletion build/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -60,6 +65,7 @@ let init args =
opts.MSBuildParams with
DisableInternalBinLog = true
}
Configuration = DotNet.BuildConfiguration.fromString configuration
}

Target.create "Build" (fun _ -> DotNet.build buildOpts "")
Expand All @@ -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
Expand Down

0 comments on commit 684f2fa

Please sign in to comment.