Skip to content

Commit

Permalink
Split CI
Browse files Browse the repository at this point in the history
  • Loading branch information
cannorin committed Aug 29, 2022
1 parent abd3080 commit 227aed1
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 8 deletions.
44 changes: 40 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: CI

on:
push:
branches: [main]
branches: [main,v2]
pull_request:
branches: [main]
branches: [main,v2]
workflow_dispatch:

jobs:
build:
build-jsoo:
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -59,4 +59,40 @@ jobs:
run: opam install . --deps-only

- name: Run FAKE
run: dotnet fake build target Test
run: dotnet fake build target TestJsoo

build-res:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
dotnet:
- 5.0.x
node-version:
- 16.x

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use .NET ${{ matrix.dotnet }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- name: Install .NET Dependencies
run: |
dotnet restore
dotnet tool restore
- name: Run FAKE
run: dotnet fake build target TestRes
9 changes: 5 additions & 4 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,18 @@ let run cmd dir args =
failwithf "Error while running '%s' with args: %s " cmd args

let platformTool tool =
ProcessUtils.tryFindFileOnPath tool
|> function Some t -> t | _ -> failwithf "%s not found" tool
lazy
ProcessUtils.tryFindFileOnPath tool
|> function Some t -> t | _ -> failwithf "%s not found" tool

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

let opamTool = platformTool "opam"
let opam args = run opamTool "./" args
let dune args = run opamTool "./" (sprintf "exec -- dune %s" args)
let opam args = run opamTool.Value "./" args
let dune args = run opamTool.Value "./" (sprintf "exec -- dune %s" args)

// Build targets

Expand Down

0 comments on commit 227aed1

Please sign in to comment.