From 2c86dd193b9daeb85b2a9abd2e49d5369e659fdd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 3 Oct 2021 16:13:12 +0200 Subject: [PATCH 1/3] Ignore changes to appveyor.yml in GitHub Actions CI workflow Don't bother rerunning GitHub CI builds when only AppVeyor configuration changes. --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 076c322a7..4bc141e41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,11 +6,13 @@ on: paths-ignore: - 'CHANGES*' - 'Doc/**' + - 'appveyor.yml' pull_request: branches: master paths-ignore: - 'CHANGES*' - 'Doc/**' + - 'appveyor.yml' jobs: build: From 7744425c219a3affff00166ad15a178bcef13178 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 3 Oct 2021 16:14:21 +0200 Subject: [PATCH 2/3] Ignore change to files not affecting the build in appveyor.yml There is no need to rerun the CI builds if only the docs, changelog or anything GitHub-related changes. --- appveyor.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index fad8f0bc0..1df9f8f2f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,6 +2,12 @@ platform: - x86 - x64 +skip_commits: + files: + - 'CHANGES*' + - 'Doc/**' + - '.github/**' + environment: global: MAKEJOBS: 2 From 1f33118077bb768c77e5a8d138d49dad274d240f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 3 Oct 2021 16:17:33 +0200 Subject: [PATCH 3/3] Don't bother building out of date PR versions on AppVeyor Exit early if there is version of the PR newer than the one that we are about to start building, to avoid wasting 3.5 hours of AppVeyor build time on the outdated PR versions. The snippet doing this was copied from https://github.com/appveyor/ci/issues/38#issuecomment-70628826 (thanks to Tony Kelman). An alternative to doing this could be enabling the "Rolling builds" option in the AppVeyor UI, see https://www.appveyor.com/docs/build-configuration/#rolling-builds but this method seems to work well in practice and is more explicit. --- appveyor.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 1df9f8f2f..10bee7ee5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -51,6 +51,13 @@ matrix: - SWIGLANG: python OSVARIANT: cygwin +init: +- ps: | + if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` + https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` + Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` + throw "There are newer queued builds for this pull request, failing early." } + install: - date /T & time /T - ps: >-