From 9cee677ce40d2412afcb9aa43244ccbe68b772a5 Mon Sep 17 00:00:00 2001 From: Carlos O'Ryan Date: Thu, 4 Jan 2018 13:04:31 -0500 Subject: [PATCH 1/4] Optimize build matrix (#1) Disable expensive builds on pull requests. --- .travis.yml | 4 ++++ appveyor.yml | 20 +++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 95f8dff1..8142575c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,15 +38,19 @@ matrix: - os: osx compiler: gcc env: BUILD_TYPE=Debug VERBOSE=1 + if: event != pull_request - os: osx compiler: gcc env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 + if: event != pull_request - os: osx compiler: clang env: BUILD_TYPE=Debug VERBOSE=1 + if: event != pull_request - os: osx compiler: clang env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 + if: event != pull_request # These are the install and build (script) phases for the most common entries in the matrix. They could be included # in each entry in the matrix, but that is just repetitive. diff --git a/appveyor.yml b/appveyor.yml index 4e8d6f6e..804e3ec7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,6 +11,7 @@ environment: - compiler: msvc-15-seh generator: "Visual Studio 15 2017 Win64" APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + enabled_on_pr: yes - compiler: msvc-14-seh generator: "Visual Studio 14 2015" @@ -43,7 +44,6 @@ environment: configuration: - Debug - #- Release build: verbosity: minimal @@ -52,6 +52,16 @@ install: - ps: | Write-Output "Compiler: $env:compiler" Write-Output "Generator: $env:generator" + Write-Output "Pull Request: <$env:APPVEYOR_PULL_REQUEST_NUMBER>" + Write-Output "Enabled on PR: <$env:enabled_on_pr>" + if (-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) { + Write-Output "This is a pull request build" + if (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes") { + Write-Output "PR builds are *NOT* explicitly enabled" + } + } else { + Write-Output "This is *NOT* a pull request build" + } # git bash conflicts with MinGW makefiles if ($env:generator -eq "MinGW Makefiles") { @@ -63,6 +73,10 @@ install: build_script: - ps: | + # Only enable some builds for pull requests, the AppVeyor queue is too long. + if (-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "")) { + return + } md _build -Force | Out-Null cd _build @@ -81,6 +95,10 @@ build_script: test_script: - ps: | + # Only enable some builds for pull requests, the AppVeyor queue is too long. + if (-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "")) { + return + } if ($env:generator -eq "MinGW Makefiles") { return # No test available for MinGW } From d3acb4ba18a545b168c106d264dd54c591c11cc7 Mon Sep 17 00:00:00 2001 From: Carlos O'Ryan Date: Fri, 5 Jan 2018 09:32:50 -0500 Subject: [PATCH 2/4] Fixed output and test for 'enabled_on_pr' --- appveyor.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 804e3ec7..f2cde6d1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -52,15 +52,13 @@ install: - ps: | Write-Output "Compiler: $env:compiler" Write-Output "Generator: $env:generator" - Write-Output "Pull Request: <$env:APPVEYOR_PULL_REQUEST_NUMBER>" - Write-Output "Enabled on PR: <$env:enabled_on_pr>" if (-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) { + Write-Output "This is *NOT* a pull request build" + } else { Write-Output "This is a pull request build" if (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes") { Write-Output "PR builds are *NOT* explicitly enabled" } - } else { - Write-Output "This is *NOT* a pull request build" } # git bash conflicts with MinGW makefiles @@ -74,7 +72,7 @@ install: build_script: - ps: | # Only enable some builds for pull requests, the AppVeyor queue is too long. - if (-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "")) { + if (-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes")) { return } md _build -Force | Out-Null @@ -96,7 +94,7 @@ build_script: test_script: - ps: | # Only enable some builds for pull requests, the AppVeyor queue is too long. - if (-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "")) { + if (-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes")) { return } if ($env:generator -eq "MinGW Makefiles") { From adfdc65ca7ed813cfb72f290f9aa2f2a1ca5bc26 Mon Sep 17 00:00:00 2001 From: Carlos O'Ryan Date: Fri, 5 Jan 2018 11:01:37 -0500 Subject: [PATCH 3/4] Fixed test for pull request. --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f2cde6d1..f73f413b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -72,7 +72,7 @@ install: build_script: - ps: | # Only enable some builds for pull requests, the AppVeyor queue is too long. - if (-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes")) { + if ((Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes")) { return } md _build -Force | Out-Null @@ -94,7 +94,7 @@ build_script: test_script: - ps: | # Only enable some builds for pull requests, the AppVeyor queue is too long. - if (-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes")) { + if ((Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes")) { return } if ($env:generator -eq "MinGW Makefiles") { From 67d6e467285d7765d3df60093d23ba3b86838470 Mon Sep 17 00:00:00 2001 From: Carlos O'Ryan Date: Fri, 5 Jan 2018 14:58:48 -0500 Subject: [PATCH 4/4] Use correct name for build event types. --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8142575c..180728a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,19 +38,19 @@ matrix: - os: osx compiler: gcc env: BUILD_TYPE=Debug VERBOSE=1 - if: event != pull_request + if: type != pull_request - os: osx compiler: gcc env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 - if: event != pull_request + if: type != pull_request - os: osx compiler: clang env: BUILD_TYPE=Debug VERBOSE=1 - if: event != pull_request + if: type != pull_request - os: osx compiler: clang env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 - if: event != pull_request + if: type != pull_request # These are the install and build (script) phases for the most common entries in the matrix. They could be included # in each entry in the matrix, but that is just repetitive.