Skip to content

Commit 03f5d40

Browse files
committed
Update build and test action
1 parent 4a00222 commit 03f5d40

File tree

3 files changed

+45
-3
lines changed

3 files changed

+45
-3
lines changed

.github/workflows/build-and-test.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and test
2+
3+
on:
4+
push:
5+
branches: [ developer ]
6+
pull_request:
7+
branches: [ developer ]
8+
9+
jobs:
10+
build-and-test-linux:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Setup .NET 5
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: '5.0.x'
20+
- name: Restore local tools
21+
run: dotnet tool restore
22+
- name: Build and test
23+
run: dotnet fake build -t runTests
24+
25+
build-and-test-windows:
26+
27+
runs-on: windows-latest
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Setup .NET 5
32+
uses: actions/setup-dotnet@v1
33+
with:
34+
dotnet-version: '5.0.x'
35+
- name: Restore local tools
36+
run: dotnet tool restore
37+
- name: Build and test
38+
run: dotnet fake build -t runTests

build.fsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ module ProjectInfo =
6161

6262
let project = "Dash.NET"
6363

64+
let solutionFile = "Dash.NET.sln"
65+
6466
let testProject = "tests/Dash.NET.Tests/Dash.NET.Tests.fsproj"
6567

6668
let summary = "F# interface to Dash- the most downloaded framework for building ML & data science web apps"
@@ -115,8 +117,8 @@ module BasicTasks =
115117
}
116118

117119
let build = BuildTask.create "Build" [clean] {
118-
!! "src/**/*.*proj"
119-
|> Seq.iter (DotNet.build id)
120+
solutionFile
121+
|> DotNet.build id
120122
}
121123

122124
let copyBinaries = BuildTask.create "CopyBinaries" [clean; build] {
@@ -135,12 +137,15 @@ module TestTasks =
135137
open ProjectInfo
136138
open BasicTasks
137139

140+
138141
let runTests = BuildTask.create "RunTests" [clean; build; copyBinaries] {
139142
let standardParams = Fake.DotNet.MSBuild.CliArguments.Create ()
140143
Fake.DotNet.DotNet.test(fun testParams ->
141144
{
142145
testParams with
143146
Logger = Some "console;verbosity=detailed"
147+
Configuration = DotNet.BuildConfiguration.fromString configuration
148+
NoBuild = true
144149
}
145150
) testProject
146151
}

tests/Dash.NET.Tests/Dash.NET.Tests.fsproj

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<PackageReference Include="Expecto" Version="9.*" />
1616
<PackageReference Include="YoloDev.Expecto.TestSdk" Version="0.*" />
1717
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.*" />
18-
<PackageReference Update="FSharp.Core" Version="4.*" />
1918
</ItemGroup>
2019

2120
<ItemGroup>

0 commit comments

Comments
 (0)