Implement support for gitlab CI

This implements support for the gitlab CI system. Wiki, static analysis,
and build tests are implemented.
This commit is contained in:
Clayton Craft 2018-06-05 14:45:17 -07:00 committed by Clayton Craft
parent 0fdf27b207
commit 256914c1a0
No known key found for this signature in database
GPG key ID: D12B309C6C96EDE4
7 changed files with 171 additions and 14 deletions

View file

@ -6,13 +6,12 @@ import sys
def get_changed_files():
try:
raw = subprocess.check_output(['git', 'diff', '--name-only', os.environ['TRAVIS_COMMIT_RANGE']])
except (KeyError, subprocess.CalledProcessError) as e:
if 'TRAVIS_PULL_REQUEST' in os.environ and os.environ['TRAVIS_PULL_REQUEST'] == "true":
branch = os.environ['TRAVIS_PULL_REQUEST_BRANCH']
raw = subprocess.check_output(['git', 'diff', '--name-only', 'master...{}'.format(branch)])
else:
raw = subprocess.check_output(['git', 'diff', '--name-only', 'HEAD~1'])
branch = os.environ['CI_COMMIT_REF_NAME']
raw = subprocess.check_output(['git', 'diff', '--name-only',
'master...{}'.format(branch)])
except (KeyError, subprocess.CalledProcessError):
raw = subprocess.check_output(['git', 'diff', '--name-only',
'HEAD~1'])
return raw.decode().splitlines()
@ -85,11 +84,6 @@ if __name__ == "__main__":
print("usage: {} [--build]".format(sys.argv[0]))
exit(1)
if 'TRAVIS_COMMIT_RANGE' in os.environ:
print('Checking commit range: {}'.format(os.environ['TRAVIS_COMMIT_RANGE']))
if 'TRAVIS_PULL_REQUEST_BRANCH' in os.environ:
print('Checking PR branch: {}'.format(os.environ['TRAVIS_PULL_REQUEST_BRANCH']))
packages = get_changed_packages()
if len(packages) == 0: