cake-build / cake

:cake: Cake (C# Make) is a cross platform build automation system.
https://cakebuild.net
MIT License
3.87k stars 727 forks source link

GitHub Actions group commands not accessible from task setup and teardown #4075

Closed gitfool closed 1 year ago

gitfool commented 1 year ago

Prerequisites

Cake runner

Cake .NET Tool

Cake version

3.0.0

Operating system

Linux

Operating system architecture

64-Bit

CI Server

GitHub Actions

What are you seeing?

After I updated gitfool/Cake.Dungeon for Cake v3, I tried to change it to use the GitHub Actions group commands from task setup and teardown but this fails with an unexpected error:

Compiling build script...
/home/runner/work/Cake.Dungeon/Cake.Dungeon/scripts/bootstrap.cake(24,52): error CS0119: 'CommandAliases.Command(ICakeContext, ICollection<string>, ProcessArgumentBuilder, int, Func<CommandSettings, CommandSettings>)' is a method, which is not valid in the given context
/home/runner/work/Cake.Dungeon/Cake.Dungeon/scripts/bootstrap.cake(25,55): error CS0119: 'CommandAliases.Command(ICakeContext, ICollection<string>, ProcessArgumentBuilder, int, Func<CommandSettings, CommandSettings>)' is a method, which is not valid in the given context

What is expected?

Unless I'm missing something, this should compile and behave the same as the previous code that writes information directly to output.

Steps to Reproduce

See the code change referenced above.

Output log

No response

devlead commented 1 year ago

Think the issue is that the referenced code calls

BuildSystem.GitHubActions.Command.StartGroup

But the provider property is called Commands (plural).

https://github.com/cake-build/cake/blob/9828d7b246d332054896e52ba56983822feb3f05/src/Cake.Common/Build/GitHubActions/IGitHubActionsProvider.cs#LL37C40-L37C40

gitfool commented 1 year ago

Doh! I need more coffee.