Skip to content

Commit 732456e

Browse files
lowlydbaAppveyor
andauthored
appveyor skip commit workaround (#175)
* allow for PR to have green build status after CI commits * Update appveyor.yml * fix env variable refs * fix tests * CI produced files * Update skip_ci_commit.ps1 * CI produced files * Update appveyor.yml * CI produced files Co-authored-by: Appveyor <appveyor@lowlydba.com>
1 parent f2c731b commit 732456e

13 files changed

+234
-225
lines changed

appveyor/appveyor.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ pull_requests:
44
do_not_increment_build_number: false
55
max_jobs: 2
66
build: off
7-
skip_commits:
8-
author: Appveyor
7+
# skip_commits:
8+
# author: Appveyor
99

1010
environment:
1111
access_token:
1212
secure: 'E5I+i+CQyj9EHusDrPSQKHRXmzmpTujYAoFxlvJjvSRSEQHHzqTBIFR1VuPbwLMi'
1313
AZURE_SQL_PASS:
1414
secure: 'rYm3nE1kwpbdE7QtyLb8CjvA1ENjY3usz3Qqskf1TXU='
15+
CI_COMMIT_MSG: 'CI produced files'
1516

1617
APPVEYOR_RDP_PASSWORD: Np^VNSzJI5#OmRdUNqro2T9UVkCdZ
1718
TARGET_DB: tSQLt
@@ -66,6 +67,7 @@ clone_script:
6667
- git config --global core.safecrlf false
6768
- git clone -q --single-branch --branch=%APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH% https://github.com/LowlyDBA/dba-multitool.git %APPVEYOR_BUILD_FOLDER%
6869
- cd %APPVEYOR_BUILD_FOLDER%
70+
- ps: .\appveyor\skip_ci_commit.ps1
6971

7072
install:
7173
- ps: Install-Product node ''
@@ -92,12 +94,10 @@ for:
9294
test_script:
9395
- ps: .\appveyor\run_pester_tests.ps1 -CodeCoverage
9496

95-
# Build markdown w/ sp_doc
97+
# Build markdown with sp_doc
98+
# Upload code coverage report, push generated files
9699
after_test:
97100
- ps: .\appveyor\generate_sample_markdown.ps1
98-
99-
# Upload code coverage report, push generated files
100-
on_success:
101101
- codecov -f %COV_REPORT%
102102
- ps: .\appveyor\push_git_changes.ps1
103103

appveyor/push_git_changes.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ $StagedFiles = git diff --staged
66

77
# Commit & push if stated
88
If ($StagedFiles) {
9-
git commit -a -m "CI produced files" -q
9+
git commit -a -m $env:CI_COMMIT_MSG -q
1010
git push origin $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH -f -q
1111
}

appveyor/run_pester_tests.ps1

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ $TestFiles = Get-ChildItem -Path .\tests\*.Tests.ps1
2323
$FailedTests = 0
2424

2525
function Start-CodeCoverage {
26-
param(
27-
[string]$SqlInstance,
28-
[string]$Database,
29-
[string]$User,
30-
[string]$Pass,
31-
[bool]$IsAzureSQL,
32-
[System.ConsoleColor]$Color
33-
)
26+
param(
27+
[string]$SqlInstance,
28+
[string]$Database,
29+
[string]$User,
30+
[string]$Pass,
31+
[bool]$IsAzureSQL,
32+
[System.ConsoleColor]$Color
33+
)
34+
3435
# Setup vars
3536
$ConnString = "server=$SqlInstance;initial catalog=$Database;Trusted_Connection=yes"
3637
If ($IsAzureSQL) {
@@ -52,10 +53,10 @@ param(
5253
}
5354

5455
function Complete-CodeCoverage {
55-
param (
56-
[string]$CoverageXMLPath,
57-
[string]$Color
58-
)
56+
param (
57+
[string]$CoverageXMLPath,
58+
[string]$Color
59+
)
5960
# Stop covering
6061
Write-Host "Stopping SQLCover..." -ForegroundColor $Color
6162
$coverageResults = $global:SQLCover.Stop()

appveyor/skip_ci_commit.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Exit build with success if commit is just files generated from CI
2+
If ($env:APPVEYOR_REPO_COMMIT_MESSAGE -eq $env:CI_COMMIT_MSG) {
3+
Write-Output "Commit is CI produced files only. Skipping build."
4+
Exit-AppveyorBuild
5+
}

appveyor/sqlcover/Coverage.opencoverxml

Lines changed: 200 additions & 200 deletions
Large diffs are not rendered by default.

appveyor/sqlcover/[dbo].[sp_estindex]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ sp_estindex - Estimate a new index's size and statistics.
2121

2222
Part of the DBA MultiTool http://dba-multitool.org
2323

24-
Version: 20201109
24+
Version: 2020121
2525

2626
MIT License
2727

docs/assets/WideWorldImporters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
| Property | Value |
44
| --- | --- |
5-
| Created On | Dec 10 2020 10:05PM |
5+
| Created On | Dec 11 2020 11:46PM |
66
| SQL Server Version | 15.0.2000.5 |
77
| Compatibility Level | 130 |
88
| Collation | Latin1_General_100_CI_AS |

install_dba-multitool.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ sp_estindex - Estimate a new index's size and statistics.
13611361
13621362
Part of the DBA MultiTool http://dba-multitool.org
13631363
1364-
Version: 20201109
1364+
Version: 2020121
13651365
13661366
MIT License
13671367

sp_estindex.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ sp_estindex - Estimate a new index's size and statistics.
101101
102102
Part of the DBA MultiTool http://dba-multitool.org
103103
104-
Version: 20201109
104+
Version: 2020121
105105
106106
MIT License
107107

tests/sp_doc.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Describe "sp_doc" {
3939
}
4040
}
4141
It "All tests" {
42-
{ Invoke-DbaQuery @Hash -Query $RunTestQuery } | Should -Not -Throw -Because "tSQLt unit tests must pass"
42+
{ Invoke-DbaQuery @Hash -Query $RunTestQuery } | Should -Not -Throw -Because "tSQLt unit tests must pass"
4343
}
4444
}
4545
}

0 commit comments

Comments
 (0)