Skip to content

Commit 7742642

Browse files
robinaughdevlead
authored andcommitted
Add RWX integration test, CI config and status badge
Adds a Cake.Common.Build.RwxProvider integration test under tests/integration/ that runs whenever the build is on RWX, asserting BuildProvider.Rwx == BuildSystem.Provider and dumping every exposed environment property — modeled on the existing GitHubActions, AzurePipelines and WoodpeckerCI scripts. Adds the .rwx/cake.yml run definition (triggers on PR + push to main/develop/hotfix/*, mirroring GHA) and a Task("Rwx") target in build.cake that scopes Run-Integration-Tests to the new Cake.Common.Build.RwxProvider task so the badge tracks the provider's own health. NuGetAudit is currently set to false in the run definition — cake's existing GHA builds emit zero NU1901 warnings for NuGet.Packaging 7.3.0 Drop once NuGet.Packaging / NuGet.Protocol move off 7.3.0.
1 parent 588c121 commit 7742642

5 files changed

Lines changed: 94 additions & 1 deletion

File tree

.rwx/cake.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
on:
2+
github:
3+
pull_request:
4+
init:
5+
commit-sha: ${{ event.git.sha }}
6+
push:
7+
- if: ${{ event.git.branch == 'develop' || event.git.branch == 'main' || starts-with(event.git.branch, 'hotfix/') }}
8+
init:
9+
commit-sha: ${{ event.git.sha }}
10+
cli:
11+
init:
12+
commit-sha: ${{ event.git.sha }}
13+
14+
base:
15+
image: ubuntu:24.04
16+
config: rwx/base 1.0.2
17+
18+
tasks:
19+
- key: code
20+
call: git/clone 2.0.7
21+
with:
22+
repository: https://github.com/cake-build/cake.git
23+
ref: ${{ init.commit-sha }}
24+
fetch-full-depth: true
25+
preserve-git-dir: true
26+
27+
- key: install-dotnet
28+
use: code
29+
run: |
30+
# We clone at a commit SHA, so HEAD is detached; GitVersion needs a named branch ref.
31+
# Use plumbing commands so the working tree (including any patched files) is untouched.
32+
git branch -f develop HEAD
33+
git symbolic-ref HEAD refs/heads/develop
34+
35+
# Pre-install the latest GA SDK in the 10.0 channel (currently 10.0.3xx) so global.json's
36+
# rollForward: latestFeature has something to roll forward to. build.sh otherwise installs
37+
# exactly 10.0.201, whose NuGet client escalates NU1901 against NuGet.Packaging 7.3.0;
38+
# 10.0.3xx does not.
39+
mkdir -p .dotnet
40+
curl -Lsfo .dotnet/dotnet-install.sh https://dot.net/v1/dotnet-install.sh
41+
bash .dotnet/dotnet-install.sh --channel 10.0 --install-dir .dotnet --no-path
42+
43+
- key: build
44+
use: [code, install-dotnet]
45+
run: ./build.sh --target=Rwx --integration-tests-target=Cake.Common.Build.RwxProvider
46+
env:
47+
CAKE_INSTALL_SUPPORTED_SDKS: "true"
48+
NuGetAudit: "false"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Cake (C# Make) is a build automation system with a C# DSL to do things like comp
2727
| GitLab | Debian | [![pipeline status](https://gitlab.com/cake-build/cake/badges/develop/pipeline.svg)](https://gitlab.com/cake-build/cake/commits/develop) | |
2828
| GitHub | Windows / Ubuntu/ macOS | [![Build Status](https://github.com/cake-build/cake/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/cake-build/cake/actions/workflows/build.yml) | |
2929
| Woodpecker CI | Debian | [![Woodpecker CI status](https://ci.codeberg.org/api/badges/15091/status.svg)](https://ci.codeberg.org/repos/15091) | [![Woodpecker CI Status](https://ci.codeberg.org/api/badges/15091/status.svg)](https://ci.codeberg.org/repos/15091) |
30+
| RWX | Ubuntu | [![RWX Build Status](https://cloud.rwx.com/status_badges/cake.svg?branch=develop&definition=.rwx%2Fcake.yml&repo=cake)](https://cloud.rwx.com/runs/latest/cake?branch=develop&definition=.rwx%2Fcake.yml&repo=cake) | [![RWX Build Status](https://cloud.rwx.com/status_badges/cake.svg?branch=develop&definition=.rwx%2Fcake.yml&repo=cake)](https://cloud.rwx.com/runs/latest/cake?branch=develop&definition=.rwx%2Fcake.yml&repo=cake) |
3031

3132
## Code Coverage
3233

build.cake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,9 @@ Task("GitHubActions-Release")
492492
Task("Travis")
493493
.IsDependentOn("Run-Unit-Tests");
494494

495+
Task("Rwx")
496+
.IsDependentOn("Run-Integration-Tests");
497+
495498
Task("ReleaseNotes")
496499
.IsDependentOn("Create-Release-Notes");
497500

tests/integration/Cake.Common/Build/BuildSystemAliases.cake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#load "GitHubActions/GitHubActionsProvider.cake"
22
#load "AzurePipelines/AzurePipelinesProvider.cake"
33
#load "WoodpeckerCI/WoodpeckerCIProvider.cake"
4+
#load "Rwx/RwxProvider.cake"
45

56
Task("Cake.Common.Build.BuildSystemAliases.BuildProvider")
67
.DoesForEach(
@@ -14,4 +15,5 @@ Task("Cake.Common.Build.BuildSystemAliases")
1415
.IsDependentOn("Cake.Common.Build.BuildSystemAliases.BuildProvider")
1516
.IsDependentOn("Cake.Common.Build.GitHubActionsProvider")
1617
.IsDependentOn("Cake.Common.Build.AzurePipelinesProvider")
17-
.IsDependentOn("Cake.Common.Build.WoodpeckerCIProvider");
18+
.IsDependentOn("Cake.Common.Build.WoodpeckerCIProvider")
19+
.IsDependentOn("Cake.Common.Build.RwxProvider");
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#load "./../../../utilities/xunit.cake"
2+
3+
Task("Cake.Common.Build.RwxProvider.Provider")
4+
.Does(() => {
5+
Assert.Equal(BuildProvider.Rwx, BuildSystem.Provider);
6+
});
7+
8+
Task("Cake.Common.Build.RwxProvider.Environment")
9+
.Does(() => {
10+
Information("RWX Provider:");
11+
Information(" IsRunningOnRwx: {0}", BuildSystem.Rwx.IsRunningOnRwx);
12+
13+
Information(" Environment:");
14+
Information(" CI: {0}", BuildSystem.Rwx.Environment.CI);
15+
Information(" Rwx: {0}", BuildSystem.Rwx.Environment.Rwx);
16+
17+
Information(" Run:");
18+
Information(" Id: {0}", BuildSystem.Rwx.Environment.Run.Id);
19+
Information(" Title: {0}", BuildSystem.Rwx.Environment.Run.Title);
20+
Information(" Url: {0}", BuildSystem.Rwx.Environment.Run.Url);
21+
22+
Information(" Task:");
23+
Information(" Id: {0}", BuildSystem.Rwx.Environment.Task.Id);
24+
Information(" Url: {0}", BuildSystem.Rwx.Environment.Task.Url);
25+
Information(" AttemptNumber: {0}", BuildSystem.Rwx.Environment.Task.AttemptNumber);
26+
27+
Information(" Actor:");
28+
Information(" Id: {0}", BuildSystem.Rwx.Environment.Actor.Id);
29+
Information(" Name: {0}", BuildSystem.Rwx.Environment.Actor.Name);
30+
});
31+
32+
var rwxProviderTask = Task("Cake.Common.Build.RwxProvider")
33+
.IsDependentOn("Cake.Common.Build.RwxProvider.Environment");
34+
35+
if (BuildSystem.Rwx.IsRunningOnRwx)
36+
{
37+
rwxProviderTask
38+
.IsDependentOn("Cake.Common.Build.RwxProvider.Provider");
39+
}

0 commit comments

Comments
 (0)