mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Work on CI
This commit is contained in:
parent
a344028733
commit
c388500dfb
@ -10,8 +10,7 @@ reading. It is cross platform, running on Linux, Windows and macOS.
|
|||||||
|
|
||||||
For more information, see the [calibre About page](https://calibre-ebook.com/about)
|
For more information, see the [calibre About page](https://calibre-ebook.com/about)
|
||||||
|
|
||||||
[](https://travis-ci.org/kovidgoyal/calibre)
|
[](https://dev.azure.com/kovidgoyal/mechanize/_build/latest?definitionId=1&branchName=engine)
|
||||||
[](https://ci.appveyor.com/project/kovidgoyal/calibre)
|
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
|
@ -4,17 +4,35 @@ trigger:
|
|||||||
include:
|
include:
|
||||||
- '*'
|
- '*'
|
||||||
exclude:
|
exclude:
|
||||||
- master
|
- 'master'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
- job: 'Linux'
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'ubuntu-latest'
|
vmImage: 'ubuntu-latest'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- script: echo Hello, world!
|
- checkout: self
|
||||||
displayName: 'Run a one-line script'
|
fetchDepth: 1
|
||||||
|
|
||||||
|
- task: UsePythonVersion@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: '3.7'
|
||||||
|
architecture: 'x64'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
echo Add other tasks to build, test, and deploy your project.
|
sudo apt-get install -y gettext
|
||||||
echo See https://aka.ms/yaml
|
displayName: 'Install needed OS libs'
|
||||||
displayName: 'Run a multi-line script'
|
|
||||||
|
- script: |
|
||||||
|
python3 setup/unix-ci.py install
|
||||||
|
displayName: 'Install calibre dependencies'
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
python3 setup/unix-ci.py bootstrap
|
||||||
|
displayName: 'Bootstrap calibre'
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
python3 setup/unix-ci.py test
|
||||||
|
displayName: 'Test calibre'
|
||||||
|
@ -12,20 +12,19 @@ import time
|
|||||||
from tempfile import NamedTemporaryFile
|
from tempfile import NamedTemporaryFile
|
||||||
|
|
||||||
_plat = sys.platform.lower()
|
_plat = sys.platform.lower()
|
||||||
isosx = 'darwin' in _plat
|
ismacos = 'darwin' in _plat
|
||||||
|
|
||||||
|
|
||||||
def setenv(key, val):
|
def setenv(key, val):
|
||||||
os.environ[key] = os.path.expandvars(val)
|
os.environ[key] = os.path.expandvars(val)
|
||||||
|
|
||||||
|
|
||||||
if isosx:
|
|
||||||
|
|
||||||
SWBASE = '/sw'
|
SWBASE = '/sw'
|
||||||
SW = SWBASE + '/sw'
|
SW = SWBASE + '/sw'
|
||||||
|
|
||||||
|
if ismacos:
|
||||||
|
|
||||||
def install_env():
|
def install_env():
|
||||||
# On OS X the frameworks/dylibs contain hard coded paths, so we have to re-create the paths in the VM exactly
|
|
||||||
setenv('SWBASE', SWBASE)
|
setenv('SWBASE', SWBASE)
|
||||||
setenv('SW', SW)
|
setenv('SW', SW)
|
||||||
setenv(
|
setenv(
|
||||||
@ -35,11 +34,9 @@ if isosx:
|
|||||||
setenv('CFLAGS', '-I$SW/include')
|
setenv('CFLAGS', '-I$SW/include')
|
||||||
setenv('LDFLAGS', '-L$SW/lib')
|
setenv('LDFLAGS', '-L$SW/lib')
|
||||||
setenv('QMAKE', '$SW/qt/bin/qmake')
|
setenv('QMAKE', '$SW/qt/bin/qmake')
|
||||||
setenv('QT_PLUGIN_PATH', '$SW/qt/plugins')
|
setenv('CALIBRE_QT_PREFIX', '$SW/qt')
|
||||||
else:
|
else:
|
||||||
|
|
||||||
SW = os.path.expanduser('~/sw')
|
|
||||||
|
|
||||||
def install_env():
|
def install_env():
|
||||||
setenv('SW', SW)
|
setenv('SW', SW)
|
||||||
setenv('PATH', '$SW/bin:$PATH')
|
setenv('PATH', '$SW/bin:$PATH')
|
||||||
@ -48,7 +45,7 @@ else:
|
|||||||
setenv('LD_LIBRARY_PATH', '$SW/qt/lib:$SW/lib')
|
setenv('LD_LIBRARY_PATH', '$SW/qt/lib:$SW/lib')
|
||||||
setenv('PKG_CONFIG_PATH', '$SW/lib/pkgconfig')
|
setenv('PKG_CONFIG_PATH', '$SW/lib/pkgconfig')
|
||||||
setenv('QMAKE', '$SW/qt/bin/qmake')
|
setenv('QMAKE', '$SW/qt/bin/qmake')
|
||||||
setenv('QT_PLUGIN_PATH', '$SW/qt/plugins')
|
setenv('CALIBRE_QT_PREFIX', '$SW/qt')
|
||||||
|
|
||||||
|
|
||||||
def run(*args):
|
def run(*args):
|
||||||
@ -89,28 +86,20 @@ def run_python(*args):
|
|||||||
def main():
|
def main():
|
||||||
action = sys.argv[1]
|
action = sys.argv[1]
|
||||||
if action == 'install':
|
if action == 'install':
|
||||||
if isosx:
|
|
||||||
run('sudo', 'mkdir', '-p', SW)
|
run('sudo', 'mkdir', '-p', SW)
|
||||||
run('sudo', 'chown', '-R', os.environ['USER'], SWBASE)
|
run('sudo', 'chown', '-R', os.environ['USER'], SWBASE)
|
||||||
tball = 'osx'
|
|
||||||
else:
|
|
||||||
tball = 'linux-64'
|
|
||||||
os.makedirs(SW)
|
|
||||||
download_and_decompress(
|
|
||||||
'https://download.calibre-ebook.com/travis/{}.tar.xz'.format(tball), SW
|
|
||||||
)
|
|
||||||
|
|
||||||
run('npm install --no-optional rapydscript-ng uglify-js regenerator')
|
tball = 'macos' if ismacos else 'linux-64'
|
||||||
print(os.environ['PATH'])
|
download_and_decompress(
|
||||||
run('which rapydscript')
|
'https://download.calibre-ebook.com/ci/calibre/{}.tar.xz'.format(tball), SW
|
||||||
run('rapydscript --version')
|
)
|
||||||
|
|
||||||
elif action == 'bootstrap':
|
elif action == 'bootstrap':
|
||||||
install_env()
|
install_env()
|
||||||
run_python('setup.py bootstrap --ephemeral')
|
run_python('setup.py bootstrap --ephemeral')
|
||||||
|
|
||||||
elif action == 'test':
|
elif action == 'test':
|
||||||
if isosx:
|
if ismacos:
|
||||||
os.environ['SSL_CERT_FILE'
|
os.environ['SSL_CERT_FILE'
|
||||||
] = os.path.abspath('resources/mozilla-ca-certs.pem')
|
] = os.path.abspath('resources/mozilla-ca-certs.pem')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user