Test config closer to libSession-util

This commit is contained in:
Morgan Pretty 2024-02-07 14:18:19 +11:00
parent 5d6397764f
commit 038a960a2f

View File

@ -1,4 +1,5 @@
local docker_base = 'registry.oxen.rocks/lokinet-ci-'; local docker_base = 'registry.oxen.rocks/lokinet-ci-';
local default_deps = [];
// Log a bunch of version information to make it easier for debugging // Log a bunch of version information to make it easier for debugging
local version_info = { local version_info = {
@ -12,12 +13,65 @@ local version_info = {
// Intentionally doing a depth of 2 as libSession-util has it's own submodules (and libLokinet likely will as well) // Intentionally doing a depth of 2 as libSession-util has it's own submodules (and libLokinet likely will as well)
local clone_submodules = { local clone_submodules = {
name: 'Clone Submodules', name: 'Clone Submodules',
commands: ['git fetch --tags', 'git submodule update --init --recursive --depth=2'] commands: ['git fetch --tags', 'git submodule update --init --recursive --depth=2 --jobs=4']
}; };
// cmake options for static deps mirror // cmake options for static deps mirror
local ci_dep_mirror(want_mirror) = (if want_mirror then ' -DLOCAL_MIRROR=https://oxen.rocks/deps ' else ''); local ci_dep_mirror(want_mirror) = (if want_mirror then ' -DLOCAL_MIRROR=https://oxen.rocks/deps ' else '');
local debian_pipeline(name,
image,
arch='amd64',
deps=default_deps,
oxen_repo=false,
kitware_repo=''/* ubuntu codename, if wanted */,
allow_fail=false,
build=['echo "Error: drone build argument not set"', 'exit 1'])
= {
kind: 'pipeline',
type: 'docker',
name: name,
platform: { arch: arch },
steps: [
submodules,
{
name: 'build',
image: image,
pull: 'always',
[if allow_fail then 'failure']: 'ignore',
environment: { SSH_KEY: { from_secret: 'SSH_KEY' }, WINEDEBUG: '-all' },
commands: [] + build,
},
],
};
local debian_build(name,
image,
arch='amd64',
deps=default_deps,
build_type='Release',
lto=false,
werror=true,
cmake_extra='',
jobs=6,
tests=true,
oxen_repo=false,
kitware_repo=''/* ubuntu codename, if wanted */,
allow_fail=false)
= debian_pipeline(
name,
image,
arch=arch,
deps=deps,
oxen_repo=oxen_repo,
kitware_repo=kitware_repo,
allow_fail=allow_fail,
build=[
'./gradlew assemblePlayDebug',
]
);
[ [
// Unit tests (PRs only) // Unit tests (PRs only)
{ {
@ -32,7 +86,6 @@ local ci_dep_mirror(want_mirror) = (if want_mirror then ' -DLOCAL_MIRROR=https:/
{ {
name: 'Run Unit Tests', name: 'Run Unit Tests',
image: docker_base + 'android', image: docker_base + 'android',
environment: { ANDROID: 'android' },
commands: [ commands: [
'./gradlew testPlayDebugUnitTestCoverageReport' './gradlew testPlayDebugUnitTestCoverageReport'
], ],
@ -64,16 +117,12 @@ local ci_dep_mirror(want_mirror) = (if want_mirror then ' -DLOCAL_MIRROR=https:/
platform: { arch: 'amd64' }, platform: { arch: 'amd64' },
trigger: { event: { exclude: [ 'pull_request' ] } }, trigger: { event: { exclude: [ 'pull_request' ] } },
steps: [ steps: [
version_info,
clone_submodules, clone_submodules,
{ debian_pipeline(
name: 'Build', 'Build',
image: docker_base + 'android', docker_base + 'android',
environment: { ANDROID: 'android' }, build=[]
commands: [ ),
'./gradlew assemblePlayDebug'
],
},
{ {
name: 'Upload artifacts', name: 'Upload artifacts',
image: docker_base + 'android', image: docker_base + 'android',