Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change description
This PR reenables CI for the Android SDK. The previous CI setup was configured for CircleCI and wasn't running. Now things run again via GitHub Actions.
Workflows
Gradle Build and Tests
Builds and tests the SDKs and example app.
Doing a
./gradlew build
also runs the linter, which currently fails, so I've added-x lint
to exclude the linter. I will address the linter error in a seperate PR (#23).linter error
Instead of running only debug tests I opted for running all tests via
./gradlew test
which runstestDebug
andtestRelease
tasks in all targets (mostlysdk
but alsosdk-compose
andexample
app if we add tests there).The
setup-gradle
action will also manage build results cache, but only write to the cache from the default (main
) branch.The
google-services.json
file, which is needed to build the example app, is stored base64 encoded in the Github action secrets.Gradle Dependency Submission
The PR also adds the
dependency-submission
action from the official gradle actions pack to support vulnerability tracking in our SDK via dependabot.Fixing tests
The biggest challenge in this PR was debugging why tests were failing on CI, while they consistently passed when run locally. It turned out that the test assertions via
coVerify(...)
were flaky. They are used to verify how often a stub method was invoked from a kotlin co routine (aka, asynchronous). On my fast machine those asynchronous tasks weren't a problem. On the (presumably) slower CI machines thecoVerify
calls needed an optional timeout. I gave all a 1 second timeout which fixed the flakiness and let tests pass locally and on CI.Test Plan
Test run, fail (I saw them fail a lot!) and test failures are reported in Checks and annotated to the PR.
Type of Change
Guidelines