From 77a753d8ac4ad12732275a03ccd53a4260726be9 Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Tue, 10 Sep 2024 08:25:04 +0300 Subject: [PATCH] Upgrade to NUKE 8.1 (#35) --- .github/workflows/build.yml | 12 +- .github/workflows/pr.yml | 8 +- .nuke/build.schema.json | 150 +++++++++++---------- build/Build.CI.GitHubActions.cs | 11 +- build/_build.csproj | 2 +- src/Test262Harness/Test262StreamOptions.cs | 2 +- 6 files changed, 95 insertions(+), 90 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 52708cf..7839aed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,19 +32,19 @@ jobs: name: windows-latest runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: 'Run: Compile, Test, Pack, Publish' run: ./build.cmd Compile Test Pack Publish env: NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }} - name: 'Publish: test-results' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test-results path: artifacts/test-results - name: 'Publish: packages' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: packages path: artifacts/packages @@ -52,19 +52,19 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: 'Run: Compile, Test, Pack, Publish' run: ./build.cmd Compile Test Pack Publish env: NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }} - name: 'Publish: test-results' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test-results path: artifacts/test-results - name: 'Publish: packages' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: packages path: artifacts/packages diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 83e08f8..a4e7d4e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -25,18 +25,22 @@ on: - '**/*.*' - '!**/*.md' +concurrency: + group: ${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: windows-latest: name: windows-latest runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: 'Run: Compile, Test, Pack' run: ./build.cmd Compile Test Pack ubuntu-latest: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: 'Run: Compile, Test, Pack' run: ./build.cmd Compile Test Pack diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 2cd41d3..6990947 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -1,18 +1,77 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/build", - "title": "Build Schema", + "properties": { + "Configuration": { + "type": "string", + "enum": [ + "Debug", + "Release" + ] + }, + "IgnoreFailedSources": { + "type": "boolean", + "description": "Ignore unreachable sources during Restore" + }, + "MyGetApiKey": { + "type": "string", + "default": "Secrets must be entered via 'nuke :secrets [profile]'" + }, + "NuGetApiKey": { + "type": "string", + "default": "Secrets must be entered via 'nuke :secrets [profile]'" + }, + "NuGetSource": { + "type": "string" + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" + } + }, "definitions": { - "build": { - "type": "object", + "Host": { + "type": "string", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitbucket", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "ExecutableTarget": { + "type": "string", + "enum": [ + "Clean", + "Compile", + "Pack", + "Publish", + "Restore", + "Test" + ] + }, + "Verbosity": { + "type": "string", + "description": "", + "enum": [ + "Verbose", + "Normal", + "Minimal", + "Quiet" + ] + }, + "NukeBuild": { "properties": { - "Configuration": { - "type": "string", - "enum": [ - "Debug", - "Release" - ] - }, "Continue": { "type": "boolean", "description": "Indicates to continue a previously failed build attempt" @@ -22,45 +81,13 @@ "description": "Shows the help text for this build assembly" }, "Host": { - "type": "string", "description": "Host for execution. Default is 'automatic'", - "enum": [ - "AppVeyor", - "AzurePipelines", - "Bamboo", - "Bitbucket", - "Bitrise", - "GitHubActions", - "GitLab", - "Jenkins", - "Rider", - "SpaceAutomation", - "TeamCity", - "Terminal", - "TravisCI", - "VisualStudio", - "VSCode" - ] - }, - "IgnoreFailedSources": { - "type": "boolean", - "description": "Ignore unreachable sources during Restore" - }, - "MyGetApiKey": { - "type": "string", - "default": "Secrets must be entered via 'nuke :secrets [profile]'" + "$ref": "#/definitions/Host" }, "NoLogo": { "type": "boolean", "description": "Disables displaying the NUKE logo" }, - "NuGetApiKey": { - "type": "string", - "default": "Secrets must be entered via 'nuke :secrets [profile]'" - }, - "NuGetSource": { - "type": "string" - }, "Partition": { "type": "string", "description": "Partition to use on CI" @@ -84,47 +111,22 @@ "type": "array", "description": "List of targets to be skipped. Empty list skips all dependencies", "items": { - "type": "string", - "enum": [ - "Clean", - "Compile", - "Pack", - "Publish", - "Restore", - "Test" - ] + "$ref": "#/definitions/ExecutableTarget" } }, - "Solution": { - "type": "string", - "description": "Path to a solution file that is automatically loaded" - }, "Target": { "type": "array", "description": "List of targets to be invoked. Default is '{default_target}'", "items": { - "type": "string", - "enum": [ - "Clean", - "Compile", - "Pack", - "Publish", - "Restore", - "Test" - ] + "$ref": "#/definitions/ExecutableTarget" } }, "Verbosity": { - "type": "string", "description": "Logging verbosity during build execution. Default is 'Normal'", - "enum": [ - "Minimal", - "Normal", - "Quiet", - "Verbose" - ] + "$ref": "#/definitions/Verbosity" } } } - } + }, + "$ref": "#/definitions/NukeBuild" } diff --git a/build/Build.CI.GitHubActions.cs b/build/Build.CI.GitHubActions.cs index ec640f6..3bde8c9 100644 --- a/build/Build.CI.GitHubActions.cs +++ b/build/Build.CI.GitHubActions.cs @@ -9,8 +9,9 @@ OnPullRequestIncludePaths = ["**/*.*"], OnPullRequestExcludePaths = ["**/*.md"], PublishArtifacts = false, - CacheKeyFiles = new string[0], - InvokedTargets = [nameof(ICompile.Compile), nameof(ITest.Test), nameof(IPack.Pack)]) + CacheKeyFiles = [], + InvokedTargets = [nameof(ICompile.Compile), nameof(ITest.Test), nameof(IPack.Pack)], + ConcurrencyCancelInProgress = true) ] [GitHubActions( "build", @@ -21,10 +22,8 @@ OnPushIncludePaths = ["**/*.*"], OnPushExcludePaths = ["**/*.md"], PublishArtifacts = true, - CacheKeyFiles = new string[0], + CacheKeyFiles = [], InvokedTargets = [nameof(ICompile.Compile), nameof(ITest.Test), nameof(IPack.Pack), nameof(Publish)], ImportSecrets = ["NUGET_API_KEY", "MYGET_API_KEY"]) ] -public partial class Build -{ -} +public partial class Build; diff --git a/build/_build.csproj b/build/_build.csproj index 2cbf627..4663b28 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/Test262Harness/Test262StreamOptions.cs b/src/Test262Harness/Test262StreamOptions.cs index ce626b5..212dcb3 100644 --- a/src/Test262Harness/Test262StreamOptions.cs +++ b/src/Test262Harness/Test262StreamOptions.cs @@ -14,7 +14,7 @@ public Test262StreamOptions(IFileSystem fileSystem) public IFileSystem FileSystem { get; set; } /// - /// Sub-directories to search. Defaults to: "annexB", "built-ins", "intl402", "language" + /// Subdirectories to search. Defaults to: "annexB", "built-ins", "intl402", "language" /// public string[] SubDirectories { get; set; } = { "annexB", "built-ins", "intl402", "language" };