@@ -27,7 +27,6 @@ var artifactsDir = Directory("artifacts"); // build artifacts
27
27
var artifactsForUnitTestsDir = artifactsDir + Directory ( "UnitTests" ) ;
28
28
var unitTestAssemblies = @"./test/Ocelot.UnitTests/Ocelot.UnitTests.csproj" ;
29
29
var minCodeCoverage = 0.80d ;
30
- var coverallsRepoToken = "OCELOT_COVERALLS_TOKEN" ;
31
30
var coverallsRepo = "https://coveralls.io/github/ThreeMammals/Ocelot" ;
32
31
33
32
// acceptance testing
@@ -515,27 +514,21 @@ Task("UnitTests")
515
514
Information ( "#=============================" ) ;
516
515
if ( IsRunningInCICD ( ) && IsMainOrDevelop ( ) )
517
516
{
518
- var repoToken = EnvironmentVariable ( coverallsRepoToken ) ;
517
+ var repoToken = EnvironmentVariable ( "OCELOT_COVERALLS_TOKEN" ) ;
519
518
if ( string . IsNullOrEmpty ( repoToken ) )
520
519
{
521
- var err = $ "# Coveralls repo token not found. Set environment variable: { coverallsRepoToken } !! !";
520
+ var err = "# Coveralls repo token was not found! Set environment variable: OCELOT_COVERALLS_TOKEN !" ;
522
521
Warning ( err ) ;
523
522
throw new Exception ( err ) ;
524
523
}
525
- else
524
+ Information ( $ "# Uploading test coverage to { coverallsRepo } ") ;
525
+ var gitHEAD = GitHelper ( "rev-parse HEAD" ) ; // git rev-parse HEAD
526
+ Information ( $ "# git HEAD commit is { gitHEAD } ") ;
527
+ CoverallsNet ( coverageSummaryFile , CoverallsNetReportType . OpenCover , new CoverallsNetSettings ( )
526
528
{
527
- Information ( $ "# Uploading test coverage to { coverallsRepo } ") ;
528
- // CoverallsNet(coverageSummaryFile, CoverallsNetReportType.OpenCover, new CoverallsNetSettings()
529
- // {
530
- // RepoToken = repoToken
531
- // });
532
- Warning ( $@ "# Uploading is disabled due to the following reasons:
533
- # - App: /root/project/tools/csmacnz.Coveralls
534
- # - Framework: 'Microsoft.NETCore.App', version '6.0.0' (x64)
535
- # Upgrading csmacnz.Coveralls package to .NET 8-9 is required!!!
536
- # Repo: https://github.com/csmacnz/coveralls.net
537
- # Coveralls Language Integrations > .Net : https://docs.coveralls.io/dot-net" ) ;
538
- }
529
+ RepoToken = repoToken ,
530
+ CommitId = gitHEAD ,
531
+ } ) ;
539
532
}
540
533
else
541
534
{
0 commit comments