From b0746cbc9f1b6ad17a750fceaf4f4f3b59148c61 Mon Sep 17 00:00:00 2001 From: pigeons Date: Thu, 29 Dec 2016 01:51:16 -0800 Subject: [PATCH 1/3] Only build when code files change. Resolves #11 --- buildbot/master/master.cfg | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/buildbot/master/master.cfg b/buildbot/master/master.cfg index 98fce47..27aea7f 100644 --- a/buildbot/master/master.cfg +++ b/buildbot/master/master.cfg @@ -64,6 +64,24 @@ c['change_source'].append(changes.GitPoller( workdir='gitpoller-workdir', branch='master', pollinterval=400)) +# + +def startCompile(change): + '''Determine whether we want to start a compile pass based on the files that + have changed. Only skip compile if ALL changes are in the ignore criteria. + ''' + compile = True + for fn in change.files: + # ignore all changes to gpg keys and markdown and text files + if fn.endswith('.asc') or fn.endswith('.md') or fn.endswith('.txt'): + compile = False + # don't ignore changes to CMakeLists.txt files + elif re.match('CMakeLists.txt', fn): + compile = True + else: + return True + return compile + ####### SCHEDULERS # Configure the Schedulers, which decide how to react to incoming changes. @@ -89,6 +107,7 @@ c['schedulers'].append(schedulers.SingleBranchScheduler( c['schedulers'].append(schedulers.SingleBranchScheduler( name='kovri PR builder', + fileIsImportant=startCompile, builderNames=['kovri-all-win32','kovri-all-win64','kovri-all-freebsd64','kovri-all-osx-10.12','kovri-all-osx-10.10','kovri-all-osx-10.11','kovri-all-ubuntu-amd64','kovri-all-ubuntu-i686','kovri-all-ubuntu-arm7','kovri-all-debian-arm8'], change_filter=util.ChangeFilter(repository='https://github.com/monero-project/kovri.git') )) From dbcebd59a31cd00b379f0cc2e706f182b2d6c09f Mon Sep 17 00:00:00 2001 From: pigeons Date: Sun, 1 Jan 2017 11:04:08 -0800 Subject: [PATCH 2/3] change elif to if for matching CMakeLists.txt --- buildbot/master/master.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildbot/master/master.cfg b/buildbot/master/master.cfg index 27aea7f..741fc11 100644 --- a/buildbot/master/master.cfg +++ b/buildbot/master/master.cfg @@ -76,7 +76,7 @@ def startCompile(change): if fn.endswith('.asc') or fn.endswith('.md') or fn.endswith('.txt'): compile = False # don't ignore changes to CMakeLists.txt files - elif re.match('CMakeLists.txt', fn): + if re.match('CMakeLists.txt', fn): compile = True else: return True From 25d79b26c2653d8f6dbe55a6da3187e403809909 Mon Sep 17 00:00:00 2001 From: pigeons Date: Thu, 29 Dec 2016 01:51:16 -0800 Subject: [PATCH 3/3] Only build when code files change. Resolves #11 change elif to if for matching CMakeLists.txt ignore changes to .conf files --- buildbot/master/master.cfg | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/buildbot/master/master.cfg b/buildbot/master/master.cfg index 98fce47..e101742 100644 --- a/buildbot/master/master.cfg +++ b/buildbot/master/master.cfg @@ -64,6 +64,24 @@ c['change_source'].append(changes.GitPoller( workdir='gitpoller-workdir', branch='master', pollinterval=400)) +# + +def startCompile(change): + '''Determine whether we want to start a compile pass based on the files that + have changed. Only skip compile if ALL changes are in the ignore criteria. + ''' + compile = True + for fn in change.files: + # ignore all changes to gpg keys and markdown and text files + if fn.endswith('.asc') or fn.endswith('.md') or fn.endswith('.txt') or fn.endswith('.conf'): + compile = False + # don't ignore changes to CMakeLists.txt files + if re.match('CMakeLists.txt', fn): + compile = True + else: + return True + return compile + ####### SCHEDULERS # Configure the Schedulers, which decide how to react to incoming changes. @@ -89,6 +107,7 @@ c['schedulers'].append(schedulers.SingleBranchScheduler( c['schedulers'].append(schedulers.SingleBranchScheduler( name='kovri PR builder', + fileIsImportant=startCompile, builderNames=['kovri-all-win32','kovri-all-win64','kovri-all-freebsd64','kovri-all-osx-10.12','kovri-all-osx-10.10','kovri-all-osx-10.11','kovri-all-ubuntu-amd64','kovri-all-ubuntu-i686','kovri-all-ubuntu-arm7','kovri-all-debian-arm8'], change_filter=util.ChangeFilter(repository='https://github.com/monero-project/kovri.git') ))