-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* release/4.2.0: Bump JetBrains.Annotations from 2022.1.0 to 2022.3.1 (#114) added Cake.GitHubActions.Module (build) Switch to using latest Ubuntu image (build) Update OS'es for matrix build Bump actions/setup-dotnet from 3.0.2 to 3.0.3 Bump actions/setup-dotnet from 3.0.1 to 3.0.2 Bump actions/setup-dotnet from 3.0.0 to 3.0.1 Bump actions/setup-dotnet from 2 to 3.0.0 (maint) pinned to Cake 1.3.0 Bump Cake.Recipe from 2.2.1 to 3.0.1 Bump cake-build/cake-action from 1.4.0 to 1.4.1 Bump github/codeql-action from 1 to 2 Bump JetBrains.Annotations from 2021.3.0 to 2022.1.0 Bump actions/upload-artifact from 2 to 3 Bump actions/cache from 2.1.7 to 3 Bump actions/checkout from 2.4.0 to 3 Bump actions/setup-dotnet from 1.9.1 to 2 Bump actions/setup-dotnet from 1.9.0 to 1.9.1
- Loading branch information
Showing
18 changed files
with
265 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ windows-2019, ubuntu-18.04, macos-10.15 ] | ||
os: [windows-latest, macos-latest, ubuntu-latest] | ||
|
||
env: | ||
AZURE_PASSWORD: ${{ secrets.AZURE_PASSWORD }} | ||
|
@@ -44,46 +44,45 @@ jobs: | |
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v2.4.0 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Fetch all tags and branches | ||
run: git fetch --prune --unshallow | ||
|
||
- uses: actions/setup-dotnet@v1.9.0 | ||
- uses: actions/setup-dotnet@v3.0.3 | ||
with: | ||
# codecov and unittests need 2.1 | ||
dotnet-version: '2.1.818' | ||
- uses: actions/setup-dotnet@v1.9.0 | ||
- uses: actions/setup-dotnet@v3.0.3 | ||
with: | ||
dotnet-version: '3.1.414' | ||
- uses: actions/setup-dotnet@v1.9.0 | ||
- uses: actions/setup-dotnet@v3.0.3 | ||
with: | ||
# gitversion needs 5.0 | ||
dotnet-version: '5.0.402' | ||
- uses: actions/setup-dotnet@v1.9.0 | ||
- uses: actions/setup-dotnet@v3.0.3 | ||
with: | ||
# need at least .NET 6 rc2 to build | ||
dotnet-version: '6.0.100-rc.2.21505.57' | ||
# need at least .NET 6 to build | ||
dotnet-version: '6.0.400' | ||
include-prerelease: true | ||
|
||
- name: Cache Tools | ||
uses: actions/cache@v2.1.7 | ||
uses: actions/cache@v3 | ||
with: | ||
path: tools | ||
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} | ||
|
||
- name: Build project | ||
uses: cake-build/[email protected].0 | ||
uses: cake-build/[email protected].1 | ||
with: | ||
script-path: recipe.cake | ||
target: CI | ||
verbosity: Diagnostic | ||
cake-version: 0.38.5 | ||
cake-bootstrap: true | ||
cake-version: 1.3.0 | ||
|
||
# currently, Cake.Recipe does not upload artifacts when run on gh-actions | ||
- name: Upload Issues | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
if-no-files-found: warn | ||
name: ${{ matrix.os }} Issues | ||
|
@@ -92,9 +91,9 @@ jobs: | |
BuildArtifacts/**/coverlet/*.xml | ||
- name: Upload Packages | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v3 | ||
if: runner.os == 'Windows' | ||
with: | ||
if-no-files-found: warn | ||
name: package | ||
path: BuildArtifacts/Packages/**/* | ||
path: BuildArtifacts/Packages/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ on: | |
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-18.04 | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
|
@@ -20,45 +20,44 @@ jobs: | |
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2.4.0 | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-dotnet@v1.9.0 | ||
- uses: actions/setup-dotnet@v3.0.3 | ||
with: | ||
# codecov and unittests need 2.1 | ||
dotnet-version: '2.1.818' | ||
- uses: actions/setup-dotnet@v1.9.0 | ||
- uses: actions/setup-dotnet@v3.0.3 | ||
with: | ||
dotnet-version: '3.1.414' | ||
- uses: actions/setup-dotnet@v1.9.0 | ||
- uses: actions/setup-dotnet@v3.0.3 | ||
with: | ||
# gitversion needs 5.0 | ||
dotnet-version: '5.0.402' | ||
- uses: actions/setup-dotnet@v1.9.0 | ||
- uses: actions/setup-dotnet@v3.0.3 | ||
with: | ||
# need at least .NET 6 rc2 to build | ||
dotnet-version: '6.0.100-rc.2.21505.57' | ||
# need at least .NET 6 to build | ||
dotnet-version: '6.0.400' | ||
include-prerelease: true | ||
|
||
- name: Cache Tools | ||
uses: actions/cache@v2.1.7 | ||
uses: actions/cache@v3 | ||
with: | ||
path: tools | ||
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Build project | ||
uses: cake-build/[email protected].0 | ||
uses: cake-build/[email protected].1 | ||
with: | ||
script-path: recipe.cake | ||
target: DotNetCore-Build | ||
cake-version: 0.38.5 | ||
cake-bootstrap: true | ||
cake-version: 1.3.0 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 | ||
uses: github/codeql-action/analyze@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,4 @@ export DOTNET_NOLOGO=1 | |
|
||
dotnet tool restore | ||
|
||
dotnet cake recipe.cake --bootstrap | ||
|
||
dotnet cake recipe.cake "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"sdk": { | ||
"allowPrerelease": true, | ||
"version": "6.0.100-rc.2", | ||
"version": "6.0.400", | ||
"rollForward": "latestFeature" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/Cake.GitHubActions.Module/Cake.GitHubActions.Module.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<AssemblyName>Cake.GitHubActions.Module</AssemblyName> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Cake.Module.Shared\Cake.Module.Shared.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Cake.Core" Version="2.0.0" PrivateAssets="All" /> | ||
<PackageReference Include="Cake.Common" Version="2.0.0" PrivateAssets="All" /> | ||
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" PrivateAssets="All" /> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
using Cake.Common.Build; | ||
using Cake.Core; | ||
using Cake.Core.Diagnostics; | ||
using Cake.Module.Shared; | ||
|
||
using JetBrains.Annotations; | ||
|
||
namespace Cake.GitHubActions.Module | ||
{ | ||
/// <summary> | ||
/// <see cref="ICakeEngine"/> implementation for GitHub Actions. | ||
/// </summary> | ||
[UsedImplicitly] | ||
public sealed class GitHubActionsEngine : CakeEngineBase | ||
{ | ||
private readonly IConsole _console; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="GitHubActionsEngine"/> class. | ||
/// </summary> | ||
/// <param name="dataService">Implementation of <see cref="ICakeDataService"/>.</param> | ||
/// <param name="log">Implementation of <see cref="ICakeLog"/>.</param> | ||
/// <param name="console">Implementation of <see cref="IConsole"/>.</param> | ||
public GitHubActionsEngine(ICakeDataService dataService, ICakeLog log, IConsole console) | ||
: base(new CakeEngine(dataService, log)) | ||
{ | ||
_console = console; | ||
_engine.BeforeSetup += OnBeforeSetup; | ||
_engine.AfterSetup += OnAfterSetup; | ||
_engine.BeforeTaskSetup += OnBeforeTaskSetup; | ||
_engine.BeforeTaskTeardown += OnBeforeTaskTeardown; | ||
_engine.BeforeTeardown += OnBeforeBuildTeardown; | ||
_engine.AfterTeardown += OnAfterBuildTeardown; | ||
} | ||
|
||
private void WriteStartBlock(BuildSystem buildSystem, string name) | ||
{ | ||
if (!buildSystem.IsRunningOnGitHubActions) | ||
{ | ||
return; | ||
} | ||
|
||
_console.WriteLine($"::group::{name}"); | ||
} | ||
|
||
private void WriteEndBlock(BuildSystem buildSystem) | ||
{ | ||
if (!buildSystem.IsRunningOnGitHubActions) | ||
{ | ||
return; | ||
} | ||
|
||
_console.WriteLine("::endgroup::"); | ||
} | ||
|
||
private void OnBeforeSetup(object sender, BeforeSetupEventArgs e) | ||
{ | ||
WriteStartBlock(e.Context.BuildSystem(), "Setup"); | ||
} | ||
|
||
private void OnAfterSetup(object sender, AfterSetupEventArgs e) | ||
{ | ||
WriteEndBlock(e.Context.BuildSystem()); | ||
} | ||
|
||
private void OnBeforeTaskSetup(object sender, BeforeTaskSetupEventArgs e) | ||
{ | ||
WriteStartBlock(e.TaskSetupContext.BuildSystem(), e.TaskSetupContext.Task.Name); | ||
} | ||
|
||
private void OnBeforeTaskTeardown(object sender, BeforeTaskTeardownEventArgs e) | ||
{ | ||
WriteEndBlock(e.TaskTeardownContext.BuildSystem()); | ||
} | ||
|
||
private void OnBeforeBuildTeardown(object sender, BeforeTeardownEventArgs e) | ||
{ | ||
WriteStartBlock(e.TeardownContext.BuildSystem(), "Teardown"); | ||
} | ||
|
||
private void OnAfterBuildTeardown(object sender, AfterTeardownEventArgs e) | ||
{ | ||
WriteEndBlock(e.TeardownContext.BuildSystem()); | ||
} | ||
} | ||
} |
Oops, something went wrong.