mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-12 09:07:43 +00:00
Initial CI setup test
Added code coverage report generation (for future CI stuff) Fixed a flaky unit test
This commit is contained in:
70
.drone.jsonnet
Normal file
70
.drone.jsonnet
Normal file
@@ -0,0 +1,70 @@
|
||||
// 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',
|
||||
commands: ['git fetch --tags', 'git submodule update --init --recursive --depth=2']
|
||||
};
|
||||
|
||||
// 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: 'exec',
|
||||
name: 'Unit Tests',
|
||||
platform: { arch: 'amd64' },
|
||||
trigger: { event: { exclude: [ 'push' ] } },
|
||||
steps: [
|
||||
clone_submodules,
|
||||
{
|
||||
name: 'Run Unit Tests',
|
||||
image: 'registry.oxen.rocks/lokinet-ci-android',
|
||||
commands: [
|
||||
'./gradlew testPlayDebugUnitTestCoverageReport'
|
||||
],
|
||||
}
|
||||
],
|
||||
},
|
||||
// Validate build artifact was created by the direct branch push (PRs only)
|
||||
{
|
||||
kind: 'pipeline',
|
||||
type: 'exec',
|
||||
name: 'Check Build Artifact Existence',
|
||||
platform: { arch: 'amd64' },
|
||||
trigger: { event: { exclude: [ 'push' ] } },
|
||||
steps: [
|
||||
{
|
||||
name: 'Poll for build artifact existence',
|
||||
commands: [
|
||||
'./Scripts/drone-upload-exists.sh'
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
// Debug APK build (non-PRs only)
|
||||
{
|
||||
kind: 'pipeline',
|
||||
type: 'exec',
|
||||
name: 'Debug APK Build',
|
||||
platform: { arch: 'amd64' },
|
||||
trigger: { event: { exclude: [ 'pull_request' ] } },
|
||||
steps: [
|
||||
clone_submodules,
|
||||
{
|
||||
name: 'Build',
|
||||
image: 'registry.oxen.rocks/lokinet-ci-android',
|
||||
commands: [
|
||||
'./gradlew assemblePlayDebug'
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Upload artifacts',
|
||||
environment: { SSH_KEY: { from_secret: 'SSH_KEY' } },
|
||||
commands: [
|
||||
'./Scripts/drone-static-upload.sh'
|
||||
]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
Reference in New Issue
Block a user