Add proper detection for github-actions service
This commit is contained in:
@@ -31,6 +31,13 @@ if 'APPVEYOR' in os.environ:
|
|||||||
elif re.match(r'^macOS', os.environ['APPVEYOR_BUILD_WORKER_IMAGE']):
|
elif re.match(r'^macOS', os.environ['APPVEYOR_BUILD_WORKER_IMAGE']):
|
||||||
ci_os = 'osx'
|
ci_os = 'osx'
|
||||||
|
|
||||||
|
if 'GITHUB_ACTIONS' in os.environ:
|
||||||
|
ci_service = 'github-actions'
|
||||||
|
if os.environ['RUNNER_OS'] == 'macOS':
|
||||||
|
ci_os = 'osx'
|
||||||
|
else:
|
||||||
|
ci_os = os.environ['RUNNER_OS'].lower()
|
||||||
|
|
||||||
|
|
||||||
def find_in_file(regex, filename):
|
def find_in_file(regex, filename):
|
||||||
file = open(filename, "r")
|
file = open(filename, "r")
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
"""CI build script for Linux/MacOS/Windows on Travis/AppVeyor
|
"""CI build script for Linux/MacOS/Windows on Travis/AppVeyor/GitHub-Actions
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
@@ -43,6 +43,25 @@ def detect_context():
|
|||||||
ci['compiler'] = os.environ['CMP']
|
ci['compiler'] = os.environ['CMP']
|
||||||
buildconfig = os.environ['CONFIGURATION'].lower()
|
buildconfig = os.environ['CONFIGURATION'].lower()
|
||||||
|
|
||||||
|
if 'GITHUB_ACTIONS' in os.environ:
|
||||||
|
ci['service'] = 'github-actions'
|
||||||
|
if os.environ['RUNNER_OS'] == 'macOS':
|
||||||
|
ci['os'] = 'osx'
|
||||||
|
else:
|
||||||
|
ci['os'] = os.environ['RUNNER_OS'].lower()
|
||||||
|
ci['platform'] = 'x64'
|
||||||
|
if 'CMP' in os.environ:
|
||||||
|
ci['compiler'] = os.environ['CMP']
|
||||||
|
if ci['os'] == 'windows':
|
||||||
|
ci['choco'] += ['strawberryperl']
|
||||||
|
if 'BCFG' in os.environ:
|
||||||
|
buildconfig = os.environ['BCFG'].lower()
|
||||||
|
|
||||||
|
if re.search('static', buildconfig):
|
||||||
|
ci['static'] = True
|
||||||
|
if re.search('debug', buildconfig):
|
||||||
|
ci['debug'] = True
|
||||||
|
|
||||||
if 'STATIC' in os.environ:
|
if 'STATIC' in os.environ:
|
||||||
print("{0}WARNING: Variable 'STATIC' not supported anymore; use 'BCFG' instead{1}"
|
print("{0}WARNING: Variable 'STATIC' not supported anymore; use 'BCFG' instead{1}"
|
||||||
.format(ANSI_RED, ANSI_RESET))
|
.format(ANSI_RED, ANSI_RESET))
|
||||||
@@ -52,11 +71,6 @@ def detect_context():
|
|||||||
.format(ANSI_RED, buildconfig, ANSI_RESET))
|
.format(ANSI_RED, buildconfig, ANSI_RESET))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
if re.search('static', buildconfig):
|
|
||||||
ci['static'] = True
|
|
||||||
if re.search('debug', buildconfig):
|
|
||||||
ci['debug'] = True
|
|
||||||
|
|
||||||
if ci['static']:
|
if ci['static']:
|
||||||
ci['configuration'] = 'static'
|
ci['configuration'] = 'static'
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user