Merge pull request #6911 from mensinda/ciBionic
ci: Add Ubuntu Bionic image
This commit is contained in:
commit
6e794c380b
|
@ -31,6 +31,7 @@ jobs:
|
||||||
- { name: CUDA (on Arch), id: cuda }
|
- { name: CUDA (on Arch), id: cuda }
|
||||||
- { name: Fedora, id: fedora }
|
- { name: Fedora, id: fedora }
|
||||||
- { name: OpenSUSE, id: opensuse }
|
- { name: OpenSUSE, id: opensuse }
|
||||||
|
- { name: Ubuntu Bionic, id: bionic }
|
||||||
- { name: Ubuntu Eoan, id: eoan }
|
- { name: Ubuntu Eoan, id: eoan }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
|
@ -11,7 +11,7 @@ jobs:
|
||||||
name: Ubuntu 16.04
|
name: Ubuntu 16.04
|
||||||
runs-on: ubuntu-16.04
|
runs-on: ubuntu-16.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt update -yq
|
sudo apt update -yq
|
||||||
|
@ -39,9 +39,10 @@ jobs:
|
||||||
- { name: CUDA (on Arch), id: cuda }
|
- { name: CUDA (on Arch), id: cuda }
|
||||||
- { name: Fedora, id: fedora }
|
- { name: Fedora, id: fedora }
|
||||||
- { name: OpenSUSE, id: opensuse }
|
- { name: OpenSUSE, id: opensuse }
|
||||||
|
- { name: Ubuntu Bionic, id: bionic }
|
||||||
container: mesonbuild/${{ matrix.cfg.id }}:latest
|
container: mesonbuild/${{ matrix.cfg.id }}:latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
# All environment variables are stored inside the docker image in /ci/env_vars.sh
|
# All environment variables are stored inside the docker image in /ci/env_vars.sh
|
||||||
# They are defined in the `env` section in each image.json. CI_ARGS should be set
|
# They are defined in the `env` section in each image.json. CI_ARGS should be set
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"base_image": "ubuntu:bionic",
|
||||||
|
"env": {
|
||||||
|
"CI": "1",
|
||||||
|
"SKIP_SCIENTIFIC": "1",
|
||||||
|
"DC": "gdc"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
export LANG='C.UTF-8'
|
||||||
|
export DC=gdc
|
||||||
|
|
||||||
|
pkgs=(
|
||||||
|
python3-pytest-xdist
|
||||||
|
python3-pip libxml2-dev libxslt1-dev libyaml-dev libjson-glib-dev
|
||||||
|
wget unzip cmake doxygen
|
||||||
|
clang
|
||||||
|
pkg-config-arm-linux-gnueabihf
|
||||||
|
qt4-linguist-tools qt5-default qtbase5-private-dev
|
||||||
|
python-dev
|
||||||
|
libomp-dev
|
||||||
|
ldc
|
||||||
|
libclang-dev
|
||||||
|
libgcrypt20-dev
|
||||||
|
libgpgme-dev
|
||||||
|
libhdf5-dev openssh-server
|
||||||
|
libboost-python-dev libboost-regex-dev
|
||||||
|
libblocksruntime-dev
|
||||||
|
libperl-dev libscalapack-mpi-dev libncurses-dev
|
||||||
|
)
|
||||||
|
|
||||||
|
boost_pkgs=(atomic chrono date-time filesystem log regex serialization system test thread)
|
||||||
|
|
||||||
|
sed -i '/^#\sdeb-src /s/^#//' "/etc/apt/sources.list"
|
||||||
|
apt-get -y update
|
||||||
|
apt-get -y upgrade
|
||||||
|
apt-get -y install eatmydata
|
||||||
|
|
||||||
|
# Base stuff
|
||||||
|
eatmydata apt-get -y build-dep meson
|
||||||
|
|
||||||
|
# Add boost packages
|
||||||
|
for i in "${boost_pkgs[@]}"; do
|
||||||
|
for j in "1.62.0" "1.65.1"; do
|
||||||
|
pkgs+=("libboost-${i}${j}")
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
# packages
|
||||||
|
eatmydata apt-get -y install "${pkgs[@]}"
|
||||||
|
|
||||||
|
eatmydata python3 -m pip install codecov jsonschema
|
||||||
|
|
||||||
|
# Install the ninja 0.10
|
||||||
|
wget https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip
|
||||||
|
unzip ninja-linux.zip -d /ci
|
||||||
|
|
||||||
|
# cleanup
|
||||||
|
apt-get -y remove ninja-build
|
||||||
|
apt-get -y clean
|
||||||
|
apt-get -y autoclean
|
||||||
|
rm ninja-linux.zip
|
|
@ -71,6 +71,9 @@ class Builder(BuilderBase):
|
||||||
for key, val in self.image_def.env.items():
|
for key, val in self.image_def.env.items():
|
||||||
out_data += f'export {key}="{val}"\n'
|
out_data += f'export {key}="{val}"\n'
|
||||||
|
|
||||||
|
# Also add /ci to PATH
|
||||||
|
out_data += 'export PATH="/ci:$PATH"\n'
|
||||||
|
|
||||||
out_file.write_text(out_data)
|
out_file.write_text(out_data)
|
||||||
|
|
||||||
# make it executable
|
# make it executable
|
||||||
|
@ -157,7 +160,7 @@ class ImageTester(BuilderBase):
|
||||||
|
|
||||||
test_cmd = [
|
test_cmd = [
|
||||||
self.docker, 'run', '--rm', '-t', 'meson_test_image',
|
self.docker, 'run', '--rm', '-t', 'meson_test_image',
|
||||||
'/usr/bin/bash', '-c', 'source /ci/env_vars.sh; cd meson; ./run_tests.py $CI_ARGS'
|
'/bin/bash', '-c', 'source /ci/env_vars.sh; cd meson; ./run_tests.py $CI_ARGS'
|
||||||
]
|
]
|
||||||
if subprocess.run(test_cmd).returncode != 0:
|
if subprocess.run(test_cmd).returncode != 0:
|
||||||
raise RuntimeError('Running tests failed')
|
raise RuntimeError('Running tests failed')
|
||||||
|
|
|
@ -17,7 +17,7 @@ pkgs=(
|
||||||
libxml2-devel libxslt-devel libyaml-devel glib2-devel json-glib-devel
|
libxml2-devel libxslt-devel libyaml-devel glib2-devel json-glib-devel
|
||||||
boost-devel libboost_date_time-devel libboost_filesystem-devel libboost_locale-devel libboost_system-devel
|
boost-devel libboost_date_time-devel libboost_filesystem-devel libboost_locale-devel libboost_system-devel
|
||||||
libboost_test-devel libboost_log-devel libboost_regex-devel
|
libboost_test-devel libboost_log-devel libboost_regex-devel
|
||||||
libboost_python-py3-1_71_0-devel libboost_regex-devel
|
libboost_python3-devel libboost_regex-devel
|
||||||
)
|
)
|
||||||
|
|
||||||
# Sys update
|
# Sys update
|
||||||
|
|
|
@ -174,7 +174,7 @@ contents of an additional file into the CI log on failure.
|
||||||
Projects needed by unit tests are in the `test cases/unit`
|
Projects needed by unit tests are in the `test cases/unit`
|
||||||
subdirectory. They are not run as part of `./run_project_tests.py`.
|
subdirectory. They are not run as part of `./run_project_tests.py`.
|
||||||
|
|
||||||
#### Configuring project tests
|
### Configuring project tests
|
||||||
|
|
||||||
The (optional) `test.json` file, in the root of a test case, is used
|
The (optional) `test.json` file, in the root of a test case, is used
|
||||||
for configuring the test. All of the following root entries in the `test.json`
|
for configuring the test. All of the following root entries in the `test.json`
|
||||||
|
@ -209,17 +209,20 @@ Exanple `test.json`:
|
||||||
{ "opt1": "qwert", "opt2": "false" },
|
{ "opt1": "qwert", "opt2": "false" },
|
||||||
{ "opt1": "bad" }
|
{ "opt1": "bad" }
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"tools": {
|
||||||
|
"cmake": ">=3.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
##### env
|
#### env
|
||||||
|
|
||||||
The `env` key contains a dictionary which specifies additional
|
The `env` key contains a dictionary which specifies additional
|
||||||
environment variables to be set during the configure step of the test. `@ROOT@`
|
environment variables to be set during the configure step of the test. `@ROOT@`
|
||||||
is replaced with the absolute path of the source directory.
|
is replaced with the absolute path of the source directory.
|
||||||
|
|
||||||
##### installed
|
#### installed
|
||||||
|
|
||||||
The `installed` dict contains a list of dicts, describing which files are expected
|
The `installed` dict contains a list of dicts, describing which files are expected
|
||||||
to be installed. Each dict contains the following keys:
|
to be installed. Each dict contains the following keys:
|
||||||
|
@ -277,7 +280,7 @@ the platform matches. The following values for `platform` are currently supporte
|
||||||
| `cygwin` | Matches when the platform is cygwin |
|
| `cygwin` | Matches when the platform is cygwin |
|
||||||
| `!cygwin` | Not `cygwin` |
|
| `!cygwin` | Not `cygwin` |
|
||||||
|
|
||||||
##### matrix
|
#### matrix
|
||||||
|
|
||||||
The `matrix` section can be used to define a test matrix to run project tests
|
The `matrix` section can be used to define a test matrix to run project tests
|
||||||
with different meson options.
|
with different meson options.
|
||||||
|
@ -318,12 +321,19 @@ The above example will produce the following matrix entries:
|
||||||
- `opt1=qwert`
|
- `opt1=qwert`
|
||||||
- `opt1=qwert opt2=true`
|
- `opt1=qwert opt2=true`
|
||||||
|
|
||||||
##### do_not_set_opts
|
#### do_not_set_opts
|
||||||
|
|
||||||
Currently supported values are:
|
Currently supported values are:
|
||||||
- `prefix`
|
- `prefix`
|
||||||
- `libdir`
|
- `libdir`
|
||||||
|
|
||||||
|
#### tools
|
||||||
|
|
||||||
|
This section specifies a list of tool requirements in a simple key-value format.
|
||||||
|
If a tool is specified, it has to be present in the environment, and the version
|
||||||
|
requirement must be fulfilled match. Otherwise, the entire test is skipped
|
||||||
|
(including every element in the test matrix).
|
||||||
|
|
||||||
### Skipping integration tests
|
### Skipping integration tests
|
||||||
|
|
||||||
Meson uses several continuous integration testing systems that have slightly
|
Meson uses several continuous integration testing systems that have slightly
|
||||||
|
|
|
@ -233,6 +233,7 @@ no_meson_log_msg = 'No meson-log.txt found.'
|
||||||
|
|
||||||
system_compiler = None
|
system_compiler = None
|
||||||
compiler_id_map = {} # type: T.Dict[str, str]
|
compiler_id_map = {} # type: T.Dict[str, str]
|
||||||
|
tool_vers_map = {} # type: T.Dict[str, str]
|
||||||
|
|
||||||
class StopException(Exception):
|
class StopException(Exception):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -568,6 +569,15 @@ def gather_tests(testdir: Path) -> T.List[TestDef]:
|
||||||
# Handle the do_not_set_opts list
|
# Handle the do_not_set_opts list
|
||||||
do_not_set_opts = test_def.get('do_not_set_opts', []) # type: T.List[str]
|
do_not_set_opts = test_def.get('do_not_set_opts', []) # type: T.List[str]
|
||||||
|
|
||||||
|
# Skip tests if the tool requirements are not met
|
||||||
|
if 'tools' in test_def:
|
||||||
|
assert isinstance(test_def['tools'], dict)
|
||||||
|
for tool, vers_req in test_def['tools'].items():
|
||||||
|
if tool not in tool_vers_map:
|
||||||
|
t.skip = True
|
||||||
|
elif not mesonlib.version_compare(tool_vers_map[tool], vers_req):
|
||||||
|
t.skip = True
|
||||||
|
|
||||||
# Skip the matrix code and just update the existing test
|
# Skip the matrix code and just update the existing test
|
||||||
if 'matrix' not in test_def:
|
if 'matrix' not in test_def:
|
||||||
t.env.update(env)
|
t.env.update(env)
|
||||||
|
@ -639,7 +649,7 @@ def gather_tests(testdir: Path) -> T.List[TestDef]:
|
||||||
name = ' '.join([x[0] for x in i if x[0] is not None])
|
name = ' '.join([x[0] for x in i if x[0] is not None])
|
||||||
opts = ['-D' + x[0] for x in i if x[0] is not None]
|
opts = ['-D' + x[0] for x in i if x[0] is not None]
|
||||||
skip = any([x[1] for x in i])
|
skip = any([x[1] for x in i])
|
||||||
test = TestDef(t.path, name, opts, skip)
|
test = TestDef(t.path, name, opts, skip or t.skip)
|
||||||
test.env.update(env)
|
test.env.update(env)
|
||||||
test.installed_files = installed
|
test.installed_files = installed
|
||||||
test.do_not_set_opts = do_not_set_opts
|
test.do_not_set_opts = do_not_set_opts
|
||||||
|
@ -1102,12 +1112,24 @@ def detect_system_compiler(options):
|
||||||
|
|
||||||
def print_tool_versions():
|
def print_tool_versions():
|
||||||
tools = [
|
tools = [
|
||||||
|
{
|
||||||
|
'tool': 'ninja',
|
||||||
|
'args': ['--version'],
|
||||||
|
'regex': re.compile(r'^([0-9]+(\.[0-9]+)*(-[a-z0-9]+)?)$'),
|
||||||
|
'match_group': 1,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'tool': 'cmake',
|
'tool': 'cmake',
|
||||||
'args': ['--version'],
|
'args': ['--version'],
|
||||||
'regex': re.compile(r'^cmake version ([0-9]+(\.[0-9]+)*(-[a-z0-9]+)?)$'),
|
'regex': re.compile(r'^cmake version ([0-9]+(\.[0-9]+)*(-[a-z0-9]+)?)$'),
|
||||||
'match_group': 1,
|
'match_group': 1,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'tool': 'hotdoc',
|
||||||
|
'args': ['--version'],
|
||||||
|
'regex': re.compile(r'^([0-9]+(\.[0-9]+)*(-[a-z0-9]+)?)$'),
|
||||||
|
'match_group': 1,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_version(t: dict) -> str:
|
def get_version(t: dict) -> str:
|
||||||
|
@ -1123,6 +1145,7 @@ def print_tool_versions():
|
||||||
i = i.strip('\n\r\t ')
|
i = i.strip('\n\r\t ')
|
||||||
m = t['regex'].match(i)
|
m = t['regex'].match(i)
|
||||||
if m is not None:
|
if m is not None:
|
||||||
|
tool_vers_map[t['tool']] = m.group(t['match_group'])
|
||||||
return '{} ({})'.format(exe, m.group(t['match_group']))
|
return '{} ({})'.format(exe, m.group(t['match_group']))
|
||||||
|
|
||||||
return '{} (unknown)'.format(exe)
|
return '{} (unknown)'.format(exe)
|
||||||
|
|
|
@ -4,5 +4,8 @@
|
||||||
{"type": "implib", "platform": "cygwin", "file": "usr/lib/libcm_cmModLib"},
|
{"type": "implib", "platform": "cygwin", "file": "usr/lib/libcm_cmModLib"},
|
||||||
{"type": "implib", "platform": "!cygwin", "file": "usr/bin/libcm_cmModLib"},
|
{"type": "implib", "platform": "!cygwin", "file": "usr/bin/libcm_cmModLib"},
|
||||||
{"type": "exe", "file": "usr/bin/cm_testEXE"}
|
{"type": "exe", "file": "usr/bin/cm_testEXE"}
|
||||||
]
|
],
|
||||||
|
"tools": {
|
||||||
|
"cmake": ">=3.11"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,5 +8,8 @@
|
||||||
{"type": "exe", "file": "usr/bin/cm_testEXE"},
|
{"type": "exe", "file": "usr/bin/cm_testEXE"},
|
||||||
{"type": "pdb", "file": "usr/bin/cm_testEXE2"},
|
{"type": "pdb", "file": "usr/bin/cm_testEXE2"},
|
||||||
{"type": "exe", "file": "usr/bin/cm_testEXE2"}
|
{"type": "exe", "file": "usr/bin/cm_testEXE2"}
|
||||||
]
|
],
|
||||||
|
"tools": {
|
||||||
|
"cmake": ">=3.11"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -314,5 +314,8 @@
|
||||||
{"type": "file", "file": "usr/share/doc/foobar/html/assets/fonts/dumped.trie"},
|
{"type": "file", "file": "usr/share/doc/foobar/html/assets/fonts/dumped.trie"},
|
||||||
{"type": "file", "file": "usr/share/doc/foobar/html/assets/images/home.svg"},
|
{"type": "file", "file": "usr/share/doc/foobar/html/assets/images/home.svg"},
|
||||||
{"type": "file", "file": "usr/share/doc/foobar/html/assets/images/dumped.trie"}
|
{"type": "file", "file": "usr/share/doc/foobar/html/assets/images/dumped.trie"}
|
||||||
]
|
],
|
||||||
|
"tools": {
|
||||||
|
"hotdoc": ">=0.1.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
VERS=$(cmake --version | grep "cmake version")
|
||||||
|
VERS=${VERS//cmake version/}
|
||||||
|
|
||||||
|
echo -n $VERS
|
|
@ -6,6 +6,9 @@ if not find_program('cmake', required: false).found()
|
||||||
error('MESON_SKIP_TEST cmake binary not available.')
|
error('MESON_SKIP_TEST cmake binary not available.')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# CMake version
|
||||||
|
cm_vers = run_command(find_program('./cmVers.sh')).stdout().strip()
|
||||||
|
|
||||||
# Zlib is probably on all dev machines.
|
# Zlib is probably on all dev machines.
|
||||||
|
|
||||||
dep = dependency('ZLIB', version : '>=1.2', method : 'cmake')
|
dep = dependency('ZLIB', version : '>=1.2', method : 'cmake')
|
||||||
|
@ -48,14 +51,16 @@ depm1 = dependency('SomethingLikeZLIB', required : true, components : 'required_
|
||||||
depm2 = dependency('SomethingLikeZLIB', required : true, components : 'required_comp', method : 'cmake', cmake_module_path : ['cmake'])
|
depm2 = dependency('SomethingLikeZLIB', required : true, components : 'required_comp', method : 'cmake', cmake_module_path : ['cmake'])
|
||||||
depm3 = dependency('SomethingLikeZLIB', required : true, components : ['required_comp'], cmake_module_path : 'cmake')
|
depm3 = dependency('SomethingLikeZLIB', required : true, components : ['required_comp'], cmake_module_path : 'cmake')
|
||||||
|
|
||||||
# Test some edge cases with spaces, etc.
|
# Test some edge cases with spaces, etc. (but only for CMake >= 3.15)
|
||||||
|
|
||||||
testDep1 = dependency('ImportedTarget', required : true, method : 'cmake', cmake_module_path : 'cmake', modules: 'mesonTestLibDefs')
|
if cm_vers.version_compare('>=3.15')
|
||||||
testDep2 = dependency('ImportedTarget', required : true, method : 'cmake', cmake_module_path : 'cmake', modules : ['MesonTest::TestLibDefs'])
|
testDep1 = dependency('ImportedTarget', required : true, method : 'cmake', cmake_module_path : 'cmake', modules: 'mesonTestLibDefs')
|
||||||
testFlagSet1 = executable('testFlagSet1', ['testFlagSet.c'], dependencies: [testDep1])
|
testDep2 = dependency('ImportedTarget', required : true, method : 'cmake', cmake_module_path : 'cmake', modules : ['MesonTest::TestLibDefs'])
|
||||||
testFlagSet2 = executable('testFlagSet2', ['testFlagSet.c'], dependencies: [testDep2])
|
testFlagSet1 = executable('testFlagSet1', ['testFlagSet.c'], dependencies: [testDep1])
|
||||||
test('testFlagSetTest1', testFlagSet1)
|
testFlagSet2 = executable('testFlagSet2', ['testFlagSet.c'], dependencies: [testDep2])
|
||||||
test('testFlagSetTest2', testFlagSet2)
|
test('testFlagSetTest1', testFlagSet1)
|
||||||
|
test('testFlagSetTest2', testFlagSet2)
|
||||||
|
endif
|
||||||
|
|
||||||
# Try to compile a test that takes a dep and an include_directories
|
# Try to compile a test that takes a dep and an include_directories
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue