Closed gitfool closed 1 year ago
Could you add some integration tests here: https://github.com/cake-build/cake/blob/develop/tests/integration/Cake.Common/Build/GitHubActions/GitHubActionsProvider.cake
Wonder if group / endgroup should have an IDisposable helper so one could do a using statement like TravisCI fold https://github.com/cake-build/cake/blob/develop/src/Cake.Common/Build/TravisCI/TravisCIDisposableExtensions.cs#L20-L28
That could be in follow up PR tomorrow if your short in time.
It might take a couple of iterations to get the integration tests working satisfactorily. Bear with me.
@devlead I see the group but not the message inside the group for some reason. Is this something to do with how the integration tests are run? What am I missing?
2022-10-31T07:36:06.3862735Z ##[group]Cake group
2022-10-31T07:36:06.3863076Z ##[endgroup]
@devlead I see the group but not the message inside the group for some reason. Is this something to do with how the integration tests are run? What am I missing?
2022-10-31T07:36:06.3862735Z ##[group]Cake group 2022-10-31T07:36:06.3863076Z ##[endgroup]
Think it needs to be quoted, example of the command used in wild
if (BuildSystem.GitHubActions.IsRunningOnGitHubActions)
{
TaskSetup(context=> System.Console.WriteLine($"::group::{context.Task.Name.Quote()}"));
TaskTeardown(context=>System.Console.WriteLine("::endgroup::"));
}
Result: https://github.com/devlead/DPI/actions/runs/3348953578/jobs/5548532403#step:5:28
Hmm also looks like ::
instead of ##
🤔
No, doesn't need to be quoted, and that output is from the log which seems to be related to azure pipelines legacy. Basically the group is working fine. It's the following information output that's missing. Same problem with the secret test.
I've been using (unquoted) groups for a while: https://github.com/gitfool/Cake.Dungeon/blob/3d9f8c6fd79cb74089e7f4d6d70c68fda5c20662/scripts/bootstrap.cake#L24-L38
Annotations are working as expected. It's only the Information
output that's missing. I expect it will work fine outside of the integration tests. Good enough for now?
Annotations are working as expected. It's only the
Information
output that's missing. I expect it will work fine outside of the integration tests. Good enough for now?
Ah, the information you won't see as the integration tests run at a lower verbosity.
I switched to a Console.WriteLine
if it turns up I'm happy ;)
@gitfool your changes have been merged, thanks for your contribution 👍
Fixes #2863.
Note: implementation guided by looking at:
@devlead I'd love to squeeze in this pull request just in time for Hacktoberfest. 😉