Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable nuget cache #1218

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 34 additions & 31 deletions .build/Build.CI.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Diagnostics;
using Nuke.Common.CI.GitHubActions;
using Nuke.Common.CI.GitHubActions.Configuration;
using Rocket.Surgery.Nuke.ContinuousIntegration;
using Rocket.Surgery.Nuke.DotNetCore;
using Rocket.Surgery.Nuke.GithubActions;
Expand All @@ -10,71 +10,71 @@
"ci-ignore",
GitHubActionsImage.UbuntuLatest,
AutoGenerate = false,
On = new[] { RocketSurgeonGitHubActionsTrigger.Push },
OnPushTags = new[] { "v*" },
OnPushBranches = new[] { "master", "main", "next" },
OnPullRequestBranches = new[] { "master", "main", "next" },
Enhancements = new[] { nameof(CiIgnoreMiddleware) }
On = [RocketSurgeonGitHubActionsTrigger.Push,],
OnPushTags = ["v*",],
OnPushBranches = ["master", "main", "next",],
OnPullRequestBranches = ["master", "main", "next",],
Enhancements = [nameof(CiIgnoreMiddleware),]
)]
[GitHubActionsSteps(
"ci",
GitHubActionsImage.UbuntuLatest,
AutoGenerate = false,
On = new[] { RocketSurgeonGitHubActionsTrigger.Push },
OnPushTags = new[] { "v*" },
OnPushBranches = new[] { "master", "main", "next" },
OnPullRequestBranches = new[] { "master", "main", "next" },
InvokedTargets = new[] { nameof(Default) },
NonEntryTargets = new[]
{
On = [RocketSurgeonGitHubActionsTrigger.Push,],
OnPushTags = ["v*",],
OnPushBranches = ["master", "main", "next",],
OnPullRequestBranches = ["master", "main", "next",],
InvokedTargets = [nameof(Default),],
NonEntryTargets =
[
nameof(ICIEnvironment.CIEnvironment),
nameof(ITriggerCodeCoverageReports.TriggerCodeCoverageReports),
nameof(ITriggerCodeCoverageReports.GenerateCodeCoverageReportCobertura),
nameof(IGenerateCodeCoverageBadges.GenerateCodeCoverageBadges),
nameof(IGenerateCodeCoverageReport.GenerateCodeCoverageReport),
nameof(IGenerateCodeCoverageSummary.GenerateCodeCoverageSummary),
nameof(Default)
},
ExcludedTargets = new[] { nameof(ICanClean.Clean), nameof(ICanRestoreWithDotNetCore.DotnetToolRestore) },
Enhancements = new[] { nameof(CiMiddleware) }
nameof(Default),
],
ExcludedTargets = [nameof(ICanClean.Clean), nameof(ICanRestoreWithDotNetCore.DotnetToolRestore),],
Enhancements = [nameof(CiMiddleware),]
)]
[GitHubActionsLint(
"lint",
GitHubActionsImage.UbuntuLatest,
AutoGenerate = false,
OnPullRequestTargetBranches = new[] { "master", "main", "next" },
Enhancements = new[] { nameof(LintStagedMiddleware) }
OnPullRequestTargetBranches = ["master", "main", "next",],
Enhancements = [nameof(LintStagedMiddleware),]
)]
[PrintBuildVersion]
[PrintCIEnvironment]
[UploadLogs]
[TitleEvents]
[ContinuousIntegrationConventions]
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public partial class Pipeline
{
public static RocketSurgeonGitHubActionsConfiguration CiIgnoreMiddleware(RocketSurgeonGitHubActionsConfiguration configuration)
{
((RocketSurgeonsGithubActionsJob)configuration.Jobs[0]).Steps = new List<GitHubActionsStep>
{
( (RocketSurgeonsGithubActionsJob)configuration.Jobs[0] ).Steps =
[
new RunStep("N/A")
{
Run = "echo \"No build required\""
}
};
Run = "echo \"No build required\"",
},
];

return configuration.IncludeRepositoryConfigurationFiles();
}

public static RocketSurgeonGitHubActionsConfiguration CiMiddleware(RocketSurgeonGitHubActionsConfiguration configuration)
{
configuration
_ = configuration
.ExcludeRepositoryConfigurationFiles()
.AddNugetPublish()
.Jobs.OfType<RocketSurgeonsGithubActionsJob>()
.First(z => z.Name.Equals("build", StringComparison.OrdinalIgnoreCase))
.UseDotNetSdks("6.0", "8.0")
.AddNuGetCache()
// .ConfigureForGitVersion()
.UseDotNetSdks("8.0")
// .ConfigureForGitVersion()
.ConfigureStep<CheckoutStep>(step => step.FetchDepth = 0)
.PublishLogs<Pipeline>();

Expand All @@ -83,11 +83,14 @@

public static RocketSurgeonGitHubActionsConfiguration LintStagedMiddleware(RocketSurgeonGitHubActionsConfiguration configuration)
{
configuration
_ = configuration
.Jobs.OfType<RocketSurgeonsGithubActionsJob>()
.First(z => z.Name.Equals("Build", StringComparison.OrdinalIgnoreCase))
.UseDotNetSdks("6.0", "8.0");
.UseDotNetSdks("8.0");

return configuration;
}
}

[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string DebuggerDisplay => ToString();

Check warning on line 95 in .build/Build.CI.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference return.

Check warning on line 95 in .build/Build.CI.cs

View workflow job for this annotation

GitHub Actions / lint

Possible null reference return.
}
13 changes: 0 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,13 @@ permissions:

jobs:
build:
env:
NUGET_PACKAGES: '${{ github.workspace }}/.nuget/packages'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
clean: 'false'
fetch-depth: '0'
- name: NuGet Cache
uses: actions/cache@v4
with:
path: '${{ github.workspace }}/.nuget/packages'
key: "${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}-${{ hashFiles('**/Directory.Packages.support.props') }}"
restore-keys: |
${{ runner.os }}-nuget-
- name: 🔨 Use .NET Core 6.0 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: 🔨 Use .NET Core 8.0 SDK
uses: actions/setup-dotnet@v4
with:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ jobs:
id: commit-message
run: |
echo "message=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
- name: 🔨 Use .NET Core 6.0 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: 🔨 Use .NET Core 8.0 SDK
uses: actions/setup-dotnet@v4
with:
Expand Down
Loading