Skip to content

Commit

Permalink
Setup basic build and test
Browse files Browse the repository at this point in the history
Corrected workflow folder name

Reduce the runners

Correct the script name

re-add other runners
  • Loading branch information
franhoey committed Jan 8, 2024
1 parent 57332ad commit 26bf3c5
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 9 deletions.
45 changes: 36 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
name: build
name: Build

on:
push:
branches:
- main
- develop
- "feature/**"
- "release/**"
- "hotfix/**"
tags:
- "*"
paths-ignore:
- "README.md"
pull_request:

on: [push]
jobs:
check-bats-version:
runs-on: ubuntu-latest
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-2022, ubuntu-22.04, macos-12 ]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- name: Checkout the repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Fetch all tags and branches
run: git fetch --prune --unshallow
- uses: actions/[email protected]
with:
dotnet-version: |
6.0
7.0
8.0
- name: Build project
uses: cake-build/[email protected]
with:
node-version: '14'
- run: npm install -g bats
- run: bats -v
script-path: build.cake
target: Build-And-Test
verbosity: Diagnostic
48 changes: 48 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
///////////////////////////////////////////////////////////////////////////////

var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");

///////////////////////////////////////////////////////////////////////////////
// TASKS
///////////////////////////////////////////////////////////////////////////////


//Todo: Add test for DisableTokenReplacement

Task("Build")
.Does(() =>
{
DotNetClean("./src/Cake.grate/Cake.grate.csproj");

var settings = new DotNetBuildSettings
{
Configuration = configuration
};

DotNetBuild("./src/Cake.grate/Cake.grate.csproj", settings);
});

Task("Test")
.Does(() =>
{
DotNetTest("./src/Cake.grate.Tests/Cake.grate.Tests.csproj");
});

Task("Build-And-Test")
.IsDependentOn("Build")
.IsDependentOn("Test");


Task("Default")
.Does(() =>
{
Information(@"The following tasks are available:
Build-And-Test: Builds the Addin and runs the Unit Tests");
});


RunTarget(target);

0 comments on commit 26bf3c5

Please sign in to comment.