diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 721cef8a77..b6394a0898 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -23,11 +23,15 @@ on: paths: - '**/*' +concurrency: + group: ${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: ubuntu-latest: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: 'Run: Compile, Test, Pack' - run: ./scripts/nuke/build.cmd Compile Test Pack + run: ./build.cmd Compile Test Pack diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index cf8918cedd..64c8bccf1f 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -1,21 +1,71 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/build", - "title": "Build Schema", + "properties": { + "AnalyseCode": { + "type": "boolean" + }, + "Configuration": { + "type": "string", + "enum": [ + "Debug", + "Release" + ] + }, + "IgnoreFailedSources": { + "type": "boolean", + "description": "Ignore unreachable sources during Restore" + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" + }, + "Version": { + "type": "string" + } + }, "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", + "Restore", + "Test" + ] + }, + "Verbosity": { + "type": "string", + "description": "", + "enum": [ + "Verbose", + "Normal", + "Minimal", + "Quiet" + ] + }, + "NukeBuild": { "properties": { - "AnalyseCode": { - "type": "boolean" - }, - "Configuration": { - "type": "string", - "enum": [ - "Debug", - "Release" - ] - }, "Continue": { "type": "boolean", "description": "Indicates to continue a previously failed build attempt" @@ -25,29 +75,8 @@ "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" + "$ref": "#/definitions/Host" }, "NoLogo": { "type": "boolean", @@ -76,48 +105,22 @@ "type": "array", "description": "List of targets to be skipped. Empty list skips all dependencies", "items": { - "type": "string", - "enum": [ - "Clean", - "Compile", - "Pack", - "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", - "Restore", - "Test" - ] + "$ref": "#/definitions/ExecutableTarget" } }, "Verbosity": { - "type": "string", "description": "Logging verbosity during build execution. Default is 'Normal'", - "enum": [ - "Minimal", - "Normal", - "Quiet", - "Verbose" - ] - }, - "Version": { - "type": "string" + "$ref": "#/definitions/Verbosity" } } } - } + }, + "$ref": "#/definitions/NukeBuild" } diff --git a/scripts/nuke/build.cmd b/build.cmd similarity index 100% rename from scripts/nuke/build.cmd rename to build.cmd diff --git a/scripts/nuke/build.ps1 b/build.ps1 similarity index 97% rename from scripts/nuke/build.ps1 rename to build.ps1 index 142856d8f4..4634dc03e9 100644 --- a/scripts/nuke/build.ps1 +++ b/build.ps1 @@ -7,7 +7,7 @@ Param( Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)" Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 } -$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent "..\.." +$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent ########################################################################### # CONFIGURATION diff --git a/scripts/nuke/build.sh b/build.sh similarity index 94% rename from scripts/nuke/build.sh rename to build.sh index 6dd88e255d..fdff0c6236 100755 --- a/scripts/nuke/build.sh +++ b/build.sh @@ -9,10 +9,10 @@ SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) # CONFIGURATION ########################################################################### -BUILD_PROJECT_FILE="$SCRIPT_DIR/../../build/_build.csproj" -TEMP_DIRECTORY="$SCRIPT_DIR/../..//.nuke/temp" +BUILD_PROJECT_FILE="$SCRIPT_DIR/build/_build.csproj" +TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp" -DOTNET_GLOBAL_FILE="$SCRIPT_DIR/../..//global.json" +DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json" DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh" DOTNET_CHANNEL="STS" diff --git a/build/Build.CI.GitHubActions.cs b/build/Build.CI.GitHubActions.cs index 052ca483e6..7b3097658e 100644 --- a/build/Build.CI.GitHubActions.cs +++ b/build/Build.CI.GitHubActions.cs @@ -8,7 +8,8 @@ OnPullRequestIncludePaths = ["**/*"], PublishArtifacts = false, InvokedTargets = [nameof(ICompile.Compile), nameof(ITest.Test), nameof(IPack.Pack)], - CacheKeyFiles = [] + CacheKeyFiles = [], + ConcurrencyCancelInProgress = true ) ] public partial class Build; \ No newline at end of file diff --git a/build/_build.csproj b/build/_build.csproj index 8e75c63341..d87073bbb6 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -19,7 +19,7 @@ - +