Skip to content

Commit 6796a30

Browse files
committed
Split CI
1 parent abd3080 commit 6796a30

File tree

2 files changed

+56
-23
lines changed

2 files changed

+56
-23
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: CI
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main,v2]
66
pull_request:
7-
branches: [main]
7+
branches: [main,v2]
88
workflow_dispatch:
99

1010
jobs:
11-
build:
11+
build-jsoo:
1212
strategy:
1313
fail-fast: false
1414
matrix:
@@ -59,4 +59,40 @@ jobs:
5959
run: opam install . --deps-only
6060

6161
- name: Run FAKE
62-
run: dotnet fake build target Test
62+
run: dotnet fake build target TestJsoo
63+
64+
build-res:
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
os:
69+
- ubuntu-latest
70+
dotnet:
71+
- 5.0.x
72+
node-version:
73+
- 16.x
74+
75+
runs-on: ${{ matrix.os }}
76+
77+
steps:
78+
- name: Checkout code
79+
uses: actions/checkout@v2
80+
81+
- name: Use .NET ${{ matrix.dotnet }}
82+
uses: actions/setup-dotnet@v1
83+
with:
84+
dotnet-version: ${{ matrix.dotnet }}
85+
86+
- name: Use Node.js ${{ matrix.node-version }}
87+
uses: actions/setup-node@v2
88+
with:
89+
node-version: ${{ matrix.node-version }}
90+
cache: yarn
91+
92+
- name: Install .NET Dependencies
93+
run: |
94+
dotnet restore
95+
dotnet tool restore
96+
97+
- name: Run FAKE
98+
run: dotnet fake build target TestRes

build.fsx

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,18 @@ let run cmd dir args =
4141
failwithf "Error while running '%s' with args: %s " cmd args
4242

4343
let platformTool tool =
44-
ProcessUtils.tryFindFileOnPath tool
45-
|> function Some t -> t | _ -> failwithf "%s not found" tool
44+
lazy
45+
ProcessUtils.tryFindFileOnPath tool
46+
|> function Some t -> t | _ -> failwithf "%s not found" tool
4647

4748
let dotnetExec cmd args =
4849
let result = DotNet.exec id cmd args
4950
if not result.OK then
5051
failwithf "Error while running 'dotnet %s %s'" cmd args
5152

5253
let opamTool = platformTool "opam"
53-
let opam args = run opamTool "./" args
54-
let dune args = run opamTool "./" (sprintf "exec -- dune %s" args)
54+
let opam args = run opamTool.Value "./" args
55+
let dune args = run opamTool.Value "./" (sprintf "exec -- dune %s" args)
5556

5657
// Build targets
5758

@@ -89,27 +90,24 @@ Target.create "Watch" <| fun _ ->
8990
dotnetExec "fable" $"watch {srcDir} --sourceMaps --define DEBUG --run webpack -w --mode=development"
9091

9192
Target.create "Test" ignore
92-
Target.create "TestOnly" ignore
93-
Target.create "TestComplete" ignore
9493

9594
"Clean"
96-
==> "YarnInstall"
95+
?=> "YarnInstall"
9796
==> "Restore"
9897
==> "Prepare"
99-
==> "Build"
10098

101-
"TestOnly"
102-
==> "TestComplete"
103-
==> "Test"
99+
"Prepare"
100+
==> "BuildForTest"
104101

105102
"Prepare"
106-
?=> "BuildForTest"
107-
?=> "TestComplete"
108-
?=> "BuildForPublish"
103+
==> "BuildForPublish"
109104
==> "Build"
110105

111106
"Prepare"
112-
?=> "Watch"
107+
==> "Test"
108+
109+
"Prepare"
110+
==> "Watch"
113111

114112
// Test targets
115113

@@ -226,7 +224,7 @@ Target.create "TestJsoo" ignore
226224
==> "TestJsooGenerateBindings"
227225
==> "TestJsooBuild"
228226
==> "TestJsoo"
229-
==> "TestOnly"
227+
==> "Test"
230228

231229
Target.create "TestResClean" <| fun _ -> Test.Res.clean ()
232230
Target.create "TestResGenerateBindings" <| fun _ -> Test.Res.generateBindings ()
@@ -238,7 +236,7 @@ Target.create "TestRes" ignore
238236
==> "TestResGenerateBindings"
239237
==> "TestResBuild"
240238
==> "TestRes"
241-
==> "TestOnly"
239+
==> "Test"
242240

243241
// Publish targets
244242

@@ -287,7 +285,6 @@ module Publish =
287285
inDirectory targetDir <| fun () -> dune "build"
288286

289287
Target.create "Publish" <| fun _ -> ()
290-
Target.create "PublishOnly" <| fun _ -> ()
291288

292289
Target.create "PublishNpm" <| fun _ ->
293290
Publish.Npm.updateVersion ()
@@ -300,7 +297,6 @@ Target.create "PublishJsoo" <| fun _ ->
300297
"BuildForPublish"
301298
==> "PublishNpm"
302299
==> "PublishJsoo"
303-
==> "PublishOnly"
304300
==> "Publish"
305301

306302
"TestJsoo" ==> "PublishJsoo"
@@ -309,6 +305,7 @@ Target.create "PublishJsoo" <| fun _ ->
309305

310306
Target.create "All" ignore
311307

308+
"Prepare" ==> "All"
312309
"Build"
313310
==> "Test"
314311
==> "Publish"

0 commit comments

Comments
 (0)