session-android/.drone.jsonnet

88 lines
2.3 KiB
Plaintext
Raw Normal View History

2024-02-07 02:51:01 +00:00
local docker_base = 'registry.oxen.rocks/lokinet-ci-';
// Log a bunch of version information to make it easier for debugging
local version_info = {
name: 'Version Information',
commands: [
'/usr/lib/android-ndk --version',
'/usr/lib/android-sdk --version'
]
};
// Intentionally doing a depth of 2 as libSession-util has it's own submodules (and libLokinet likely will as well)
local clone_submodules = {
name: 'Clone Submodules',
image: 'drone/git',
2024-02-07 03:18:19 +00:00
commands: ['git fetch --tags', 'git submodule update --init --recursive --depth=2 --jobs=4']
};
// cmake options for static deps mirror
local ci_dep_mirror(want_mirror) = (if want_mirror then ' -DLOCAL_MIRROR=https://oxen.rocks/deps ' else '');
[
// Unit tests (PRs only)
{
kind: 'pipeline',
type: 'docker',
name: 'Unit Tests',
platform: { arch: 'amd64' },
trigger: { event: { exclude: [ 'push' ] } },
steps: [
clone_submodules,
{
name: 'Run Unit Tests',
2024-02-07 03:28:03 +00:00
pull: 'always',
2024-02-07 02:51:01 +00:00
image: docker_base + 'android',
commands: [
'./gradlew testPlayDebugUnitTestCoverageReport'
],
}
],
},
// Validate build artifact was created by the direct branch push (PRs only)
{
kind: 'pipeline',
type: 'docker',
name: 'Check Build Artifact Existence',
platform: { arch: 'amd64' },
trigger: { event: { exclude: [ 'push' ] } },
steps: [
{
name: 'Poll for build artifact existence',
2024-02-07 03:28:03 +00:00
pull: 'always',
2024-02-07 02:51:01 +00:00
image: docker_base + 'android',
commands: [
'./Scripts/drone-upload-exists.sh'
]
}
]
},
// Debug APK build (non-PRs only)
{
kind: 'pipeline',
type: 'docker',
name: 'Debug APK Build',
platform: { arch: 'amd64' },
trigger: { event: { exclude: [ 'pull_request' ] } },
steps: [
clone_submodules,
{
name: 'Build',
2024-02-07 03:28:03 +00:00
pull: 'always',
image: docker_base + 'android',
commands: [
'./gradlew assemblePlayDebug'
],
},
{
name: 'Upload artifacts',
2024-02-07 03:28:03 +00:00
pull: 'always',
2024-02-07 02:51:01 +00:00
image: docker_base + 'android',
environment: { SSH_KEY: { from_secret: 'SSH_KEY' } },
commands: [
'./Scripts/drone-static-upload.sh'
]
},
],
}
]