Skip to content

Commit

Permalink
fix: skip artifact validation for doc-only PRs (electron#39296)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere authored Jul 31, 2023
1 parent 724f90a commit 8e5bb49
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 34 deletions.
40 changes: 23 additions & 17 deletions appveyor-woa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ for:
- ps: |
node script/yarn.js install --frozen-lockfile
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "false"
if ($LASTEXITCODE -eq 0) {
Write-warning "Skipping build for doc only change"
Write-warning "Skipping build for doc-only change"
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "true"
Exit-AppveyorBuild
} else {
$global:LASTEXITCODE = 0
Expand Down Expand Up @@ -206,25 +208,29 @@ for:
- ps: |
cd C:\projects\src
$missing_artifacts = $false
$artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip')
foreach($artifact_name in $artifacts_to_upload) {
if ($artifact_name -eq 'ffmpeg.zip') {
$artifact_file = "out\ffmpeg\ffmpeg.zip"
} elseif ($artifact_name -eq 'node_headers.zip') {
$artifact_file = $artifact_name
} else {
$artifact_file = "out\Default\$artifact_name"
if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') {
Write-warning "Skipping artifact validation for doc-only PR"
} else {
$artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip')
foreach($artifact_name in $artifacts_to_upload) {
if ($artifact_name -eq 'ffmpeg.zip') {
$artifact_file = "out\ffmpeg\ffmpeg.zip"
} elseif ($artifact_name -eq 'node_headers.zip') {
$artifact_file = $artifact_name
} else {
$artifact_file = "out\Default\$artifact_name"
}
if (Test-Path $artifact_file) {
appveyor-retry appveyor PushArtifact $artifact_file
} else {
Write-warning "$artifact_name is missing and cannot be added to artifacts"
$missing_artifacts = $true
}
}
if (Test-Path $artifact_file) {
appveyor-retry appveyor PushArtifact $artifact_file
} else {
Write-warning "$artifact_name is missing and cannot be added to artifacts"
$missing_artifacts = $true
if ($missing_artifacts) {
throw "Build failed due to missing artifacts"
}
}
if ($missing_artifacts) {
throw "Build failed due to missing artifacts"
}
- ps: >-
if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) {
appveyor-retry appveyor PushArtifact pdb.zip
Expand Down
41 changes: 24 additions & 17 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ for:
- ps: |
node script/yarn.js install --frozen-lockfile
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "false"
if ($LASTEXITCODE -eq 0) {
Write-warning "Skipping build for doc only change"
Write-warning "Skipping build for doc-only change"
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "true"
Exit-AppveyorBuild
} else {
$global:LASTEXITCODE = 0
Expand Down Expand Up @@ -204,25 +206,30 @@ for:
- ps: |
cd C:\projects\src
$missing_artifacts = $false
$artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip')
foreach($artifact_name in $artifacts_to_upload) {
if ($artifact_name -eq 'ffmpeg.zip') {
$artifact_file = "out\ffmpeg\ffmpeg.zip"
} elseif ($artifact_name -eq 'node_headers.zip') {
$artifact_file = $artifact_name
} else {
$artifact_file = "out\Default\$artifact_name"
if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') {
Write-warning "Skipping artifact validation for doc-only PR"
} else {
$artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip')
foreach($artifact_name in $artifacts_to_upload) {
if ($artifact_name -eq 'ffmpeg.zip') {
$artifact_file = "out\ffmpeg\ffmpeg.zip"
} elseif ($artifact_name -eq 'node_headers.zip') {
$artifact_file = $artifact_name
} else {
$artifact_file = "out\Default\$artifact_name"
}
if (Test-Path $artifact_file) {
appveyor-retry appveyor PushArtifact $artifact_file
} else {
Write-warning "$artifact_name is missing and cannot be added to artifacts"
$missing_artifacts = $true
}
}
if (Test-Path $artifact_file) {
appveyor-retry appveyor PushArtifact $artifact_file
} else {
Write-warning "$artifact_name is missing and cannot be added to artifacts"
$missing_artifacts = $true
if ($missing_artifacts) {
throw "Build failed due to missing artifacts"
}
}
if ($missing_artifacts) {
throw "Build failed due to missing artifacts"
}
- ps: >-
if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) {
appveyor-retry appveyor PushArtifact pdb.zip
Expand Down

0 comments on commit 8e5bb49

Please sign in to comment.