1
1
using System . Collections . Generic ;
2
2
using System . Linq ;
3
3
using Nuke . Common . CI . GitHubActions ;
4
- using Rocket . Surgery . Nuke ;
5
4
using Rocket . Surgery . Nuke . ContinuousIntegration ;
6
5
using Rocket . Surgery . Nuke . DotNetCore ;
7
6
using Rocket . Surgery . Nuke . GithubActions ;
8
7
9
- [ AzurePipelinesSteps (
10
- AutoGenerate = false ,
11
- InvokeTargets = new [ ] { nameof ( Default ) } ,
12
- NonEntryTargets = new [ ] {
13
- nameof ( ICIEnvironment . CIEnvironment ) ,
14
- nameof ( ITriggerCodeCoverageReports . TriggerCodeCoverageReports ) ,
15
- nameof ( ITriggerCodeCoverageReports . GenerateCodeCoverageReportCobertura ) ,
16
- nameof ( IGenerateCodeCoverageBadges . GenerateCodeCoverageBadges ) ,
17
- nameof ( IGenerateCodeCoverageReport . GenerateCodeCoverageReport ) ,
18
- nameof ( IGenerateCodeCoverageSummary . GenerateCodeCoverageSummary ) ,
19
- nameof ( Default )
20
- } ,
21
- ExcludedTargets = new [ ]
22
- { nameof ( ICanClean . Clean ) , nameof ( ICanRestoreWithDotNetCore . Restore ) , nameof ( ICanRestoreWithDotNetCore . DotnetToolRestore ) } ,
23
- Parameters = new [ ] {
24
- nameof ( IHaveCodeCoverage . CoverageDirectory ) , nameof ( IHaveOutputArtifacts . ArtifactsDirectory ) , nameof ( Verbosity ) ,
25
- nameof ( IHaveConfiguration . Configuration )
26
- }
27
- ) ]
28
8
[ GitHubActionsSteps (
29
9
"ci" ,
30
10
GitHubActionsImage . MacOsLatest ,
@@ -64,8 +44,10 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi
64
44
checkoutStep . FetchDepth = 0 ;
65
45
buildJob . Environment [ "NUGET_PACKAGES" ] = "${{ github.workspace }}/.nuget/packages" ;
66
46
buildJob . Steps . InsertRange (
67
- buildJob . Steps . IndexOf ( checkoutStep ) + 1 , new BaseGitHubActionsStep [ ] {
68
- new RunStep ( "Fetch all history for all tags and branches" ) {
47
+ buildJob . Steps . IndexOf ( checkoutStep ) + 1 , new BaseGitHubActionsStep [ ]
48
+ {
49
+ new RunStep ( "Fetch all history for all tags and branches" )
50
+ {
69
51
Run = "git fetch --prune"
70
52
} ,
71
53
new UsingStep ( "NuGet Cache" )
@@ -81,51 +63,59 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi
81
63
${{ runner.os }}-nuget-"
82
64
}
83
65
} ,
84
- new SetupDotNetStep ( "Use .NET Core 3.1 SDK" ) {
66
+ new SetupDotNetStep ( "Use .NET Core 3.1 SDK" )
67
+ {
85
68
DotNetVersion = "3.1.x"
86
69
} ,
87
- new SetupDotNetStep ( "Use .NET Core 6.0 SDK" ) {
70
+ new SetupDotNetStep ( "Use .NET Core 6.0 SDK" )
71
+ {
88
72
DotNetVersion = "6.0.x"
89
73
} ,
90
74
}
91
75
) ;
92
76
93
77
buildJob . Steps . Add (
94
- new UsingStep ( "Publish Coverage" ) {
78
+ new UsingStep ( "Publish Coverage" )
79
+ {
95
80
Uses = "codecov/codecov-action@v1" ,
96
- With = new Dictionary < string , string > {
81
+ With = new Dictionary < string , string >
82
+ {
97
83
[ "name" ] = "actions-${{ matrix.os }}" ,
98
84
[ "fail_ci_if_error" ] = "true" ,
99
85
}
100
86
}
101
87
) ;
102
88
103
89
buildJob . Steps . Add (
104
- new UploadArtifactStep ( "Publish logs" ) {
90
+ new UploadArtifactStep ( "Publish logs" )
91
+ {
105
92
Name = "logs" ,
106
93
Path = "artifacts/logs/" ,
107
94
If = "always()"
108
95
}
109
96
) ;
110
97
111
98
buildJob . Steps . Add (
112
- new UploadArtifactStep ( "Publish coverage data" ) {
99
+ new UploadArtifactStep ( "Publish coverage data" )
100
+ {
113
101
Name = "coverage" ,
114
102
Path = "coverage/" ,
115
103
If = "always()"
116
104
}
117
105
) ;
118
106
119
107
buildJob . Steps . Add (
120
- new UploadArtifactStep ( "Publish test data" ) {
108
+ new UploadArtifactStep ( "Publish test data" )
109
+ {
121
110
Name = "test data" ,
122
111
Path = "artifacts/test/" ,
123
112
If = "always()"
124
113
}
125
114
) ;
126
115
127
116
buildJob . Steps . Add (
128
- new UploadArtifactStep ( "Publish NuGet Packages" ) {
117
+ new UploadArtifactStep ( "Publish NuGet Packages" )
118
+ {
129
119
Name = "nuget" ,
130
120
Path = "artifacts/nuget/" ,
131
121
If = "always()"
0 commit comments