1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-17 15:50:07 +00:00

Use github action as ci test.

This commit is contained in:
ly1217
2020-01-13 18:55:55 -08:00
parent 28223c17a3
commit 74cd4594d6
7 changed files with 60 additions and 59 deletions

View File

@@ -18,14 +18,14 @@ import termcolor
from serverctl import ServerCtl
from utils import (
cd, chdir, debug, green, info, lru_cache, mkdirs, on_travis, red,
cd, chdir, debug, green, info, lru_cache, mkdirs, on_github_actions, red,
setup_logging, shell, warning
)
logger = logging.getLogger(__name__)
TOPDIR = abspath(join(os.getcwd(), '..'))
if on_travis():
if on_github_actions():
PREFIX = expanduser('~/opt/local')
else:
PREFIX = os.environ.get('SEAFILE_INSTALL_PREFIX', '/usr/local')
@@ -53,7 +53,9 @@ def make_build_env():
_env_add('LDFLAGS', '-L%s' % join(PREFIX, 'lib64'), seperator=' ')
_env_add('PATH', join(PREFIX, 'bin'))
_env_add('PYTHONPATH', join(PREFIX, 'lib/python3.7/site-packages'))
if on_github_actions():
_env_add('PYTHONPATH', join(os.environ.get('RUNNER_TOOL_CACHE'), 'Python/3.6.9/x64/lib/python3.6/site-packages'))
_env_add('PYTHONPATH', join(PREFIX, 'lib/python3.6/site-packages'))
_env_add('PKG_CONFIG_PATH', join(PREFIX, 'lib', 'pkgconfig'))
_env_add('PKG_CONFIG_PATH', join(PREFIX, 'lib64', 'pkgconfig'))
_env_add('PKG_CONFIG_PATH', libsearpc_dir)
@@ -157,18 +159,38 @@ class SeafileServer(Project):
def __init__(self):
super(SeafileServer, self).__init__('seafile-server')
class Libevhtp(Project):
def __init__(self):
super(Libevhtp, self).__init__('libevhtp')
def branch(self):
return 'master'
@chdir
def compile_and_install(self):
cmds = [
'cmake -DEVHTP_DISABLE_SSL=ON -DEVHTP_BUILD_SHARED=OFF',
'make',
'sudo make install',
'sudo ldconfig',
]
for cmd in cmds:
shell(cmd)
def fetch_and_build():
libsearpc = Libsearpc()
libevhtp = Libevhtp()
ccnet = CcnetServer()
seafile = SeafileServer()
libsearpc.clone()
libsearpc.compile_and_install()
libevhtp.clone()
ccnet.clone()
ccnet.compile_and_install()
libsearpc.compile_and_install()
libevhtp.compile_and_install()
ccnet.compile_and_install()
seafile.compile_and_install()
@@ -184,9 +206,9 @@ def main():
mkdirs(INSTALLDIR)
os.environ.update(make_build_env())
args = parse_args()
if on_travis() and not args.test_only:
if on_github_actions() and not args.test_only:
fetch_and_build()
if on_travis():
if on_github_actions():
dbs = ('sqlite3', 'mysql')
else:
dbs = ('sqlite3',)