mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[ci]Exclude markdown file edits from triggering full build (#24418)
* Update ci.yml Add path exclusions for markdown files. * Update wildcard syntax * Test edit SUPPORT.md * Update ci.yml * Test Update SUPPORT.md * Update SUPPORT.md Test update SUPPORT again. * Update ci.yml * Explicit define of markdown files at root * Test update SUPPORT.md * Update ci.yml * Another Test Update SUPPORT.md * Script to check existence of markdown changes in commit * Added precheck job to determine whether a build needs to occur * Added pool logic from ci-build to precheck * Fixed GitHub API url for commits * Test change to SUPPORT.md to see if logic works. * Converted filename list to array to make notmatching criteria work * Change to SUPPORT.md to test * Updated condition to check success of previous precheck job * Added task name to verifyBuildRequest and updated job run condition * Another update to SUPPORT.md to test * Updated spell-check * Removed checkout step and made Powershell task inline * Fixed indentation * Test change to SUPPORT.md * Fixing script * Another test change to SUPPORT.md * [CI] Update Build Precheck step to use latest agent config * Update SUPPORT.md * Update SUPPORT.md * [CI] Update Build Precheck to exclude .txt and read changes from pull request * [CI] Remove unneeded verifyBuildRequest script * [CI] Updated variable names to reflect pull request retrieval in precheck
This commit is contained in:
2
.github/actions/spell-check/expect.txt
vendored
2
.github/actions/spell-check/expect.txt
vendored
@@ -1744,6 +1744,7 @@ SETTINGCHANGE
|
|||||||
SETTINGSCHANGED
|
SETTINGSCHANGED
|
||||||
settingsheader
|
settingsheader
|
||||||
settingshotkeycontrol
|
settingshotkeycontrol
|
||||||
|
setvariable
|
||||||
SETWORKAREA
|
SETWORKAREA
|
||||||
setzero
|
setzero
|
||||||
sfgao
|
sfgao
|
||||||
@@ -2143,6 +2144,7 @@ vsconfig
|
|||||||
VSCROLL
|
VSCROLL
|
||||||
vsetq
|
vsetq
|
||||||
VSM
|
VSM
|
||||||
|
vso
|
||||||
vsonline
|
vsonline
|
||||||
vstemplate
|
vstemplate
|
||||||
VSTHRD
|
VSTHRD
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/main/service-schema.json
|
||||||
trigger:
|
trigger:
|
||||||
batch: true
|
batch: true
|
||||||
branches:
|
branches:
|
||||||
@@ -9,21 +10,27 @@ trigger:
|
|||||||
- doc/*
|
- doc/*
|
||||||
- temp/*
|
- temp/*
|
||||||
- tools/*
|
- tools/*
|
||||||
|
- '**.md'
|
||||||
|
|
||||||
pr:
|
pr:
|
||||||
branches:
|
branches:
|
||||||
include:
|
include:
|
||||||
- main
|
- main
|
||||||
- stable
|
- stable
|
||||||
|
paths:
|
||||||
|
exclude:
|
||||||
|
- '**.md'
|
||||||
|
- doc
|
||||||
|
|
||||||
# 0.0.yyMM.dd##
|
# 0.0.yyMM.dd##
|
||||||
# 0.0.1904.0900
|
# 0.0.1904.0900
|
||||||
name: 0.0.$(Date:yyMM).$(Date:dd)$(Rev:rr)
|
name: 0.0.$(Date:yyMM).$(Date:dd)$(Rev:rr)
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
- template: ./templates/build-powertoys-precheck.yml
|
||||||
- template: ./templates/build-powertoys-ci.yml
|
- template: ./templates/build-powertoys-ci.yml
|
||||||
parameters:
|
parameters:
|
||||||
platform: x64
|
platform: x64
|
||||||
- template: ./templates/build-powertoys-ci.yml
|
- template: ./templates/build-powertoys-ci.yml
|
||||||
parameters:
|
parameters:
|
||||||
platform: arm64
|
platform: arm64
|
||||||
@@ -6,6 +6,8 @@ parameters:
|
|||||||
jobs:
|
jobs:
|
||||||
- job: Build${{ parameters.platform }}${{ parameters.configuration }}
|
- job: Build${{ parameters.platform }}${{ parameters.configuration }}
|
||||||
displayName: Build ${{ parameters.platform }} ${{ parameters.configuration }}
|
displayName: Build ${{ parameters.platform }} ${{ parameters.configuration }}
|
||||||
|
dependsOn: Precheck
|
||||||
|
condition: and(succeeded(),ne(dependencies.Precheck.outputs['verifyBuildRequest.skipBuild'], 'Yes'))
|
||||||
variables:
|
variables:
|
||||||
BuildConfiguration: ${{ parameters.configuration }}
|
BuildConfiguration: ${{ parameters.configuration }}
|
||||||
BuildPlatform: ${{ parameters.platform }}
|
BuildPlatform: ${{ parameters.platform }}
|
||||||
@@ -29,4 +31,4 @@ jobs:
|
|||||||
# when we renamed our main branch.
|
# when we renamed our main branch.
|
||||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||||
displayName: 'Component Detection'
|
displayName: 'Component Detection'
|
||||||
condition: and(succeededOrFailed(), not(eq(variables['Build.Reason'], 'PullRequest')))
|
condition: and(succeededOrFailed(), not(eq(variables['Build.Reason'], 'PullRequest')))
|
||||||
27
.pipelines/ci/templates/build-powertoys-precheck.yml
Normal file
27
.pipelines/ci/templates/build-powertoys-precheck.yml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json
|
||||||
|
jobs:
|
||||||
|
- job: Precheck
|
||||||
|
pool:
|
||||||
|
demands: ImageOverride -equals SHINE-VS17-Latest
|
||||||
|
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||||
|
name: SHINE-OSS-L
|
||||||
|
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||||
|
name: SHINE-INT-L
|
||||||
|
steps:
|
||||||
|
- checkout: none
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: Verify Build Request
|
||||||
|
inputs:
|
||||||
|
targetType: 'inline'
|
||||||
|
script: |
|
||||||
|
$pullRequestNumber = "$(system.pullRequest.pullRequestNumber)";
|
||||||
|
$gitHubPullRequest = Invoke-RestMethod -Method Get "https://api.github.com/repos/microsoft/PowerToys/pulls/$pullRequestNumber/files"
|
||||||
|
# If there are no files updated in the commit that are .md, set skipBuild variable
|
||||||
|
if(([array]($gitHubPullRequest.filename) -notmatch ".md|.txt").Length -eq 0)
|
||||||
|
{
|
||||||
|
Write-Host '##vso[task.setvariable variable=skipBuild;isOutput=true]Yes'
|
||||||
|
Write-Host 'Skipping Build'
|
||||||
|
}
|
||||||
|
pwsh: true
|
||||||
|
name: verifyBuildRequest
|
||||||
Reference in New Issue
Block a user