Add GitLab CI build/tests
Add GitLab CI build/tests
The funtionalTests
pipeline can't be enabled because ERROR: x86 emulation currently requires hardware acceleration!
, gitlab-org/gitlab-runner#2242
Merge request reports
Activity
added 3 commits
-
3e70a08e...f9bd0c83 - 2 commits from branch
master
- fb5d688c - Add GitLab CI build/tests
-
3e70a08e...f9bd0c83 - 2 commits from branch
mentioned in commit 2a2520c2
15 25 versionCode 81 16 26 versionName "3.2.0" 17 27 18 buildConfigField("String", "oauth_client_id", secretProperties['oauth_client_id']) 19 buildConfigField("String", "oauth_client_secret", secretProperties['oauth_client_secret']) 20 buildConfigField("String", "oauth_redirect_uri", secretProperties['oauth_redirect_uri']) 21 buildConfigField("String", "google_project_id", secretProperties['google_project_id'] ?: "null") 28 buildConfigField("String", "oauth_client_id", "\"${secretProperties['oauth_client_id']}\"") @MadLittleMods I just started diving into Gitter here! The character escaping here generates double quoted strings in the generated file
app/build/generated/source/buildConfig/debug/im/gitter/gitter/BuildConfig.java
like the following:public static final String google_project_id = ""null""; ... ... public static final String oauth_redirect_uri = ""https://gitter.im/login/oauth/callback"";
It think it's safe to change this to the following. What do you think?
buildConfigField("String", "oauth_client_id", "${secretProperties['oauth_client_id']}") ...
Edited by George Tsiolis@gtsiolis From my experience, the double quotes were needed as it literally puts the value in quotes into the build config file output.
You can see an example here,
@MadLittleMods but generating the BuildConfig.java as the following won't allow the app to build successfully. Maybe there's a another way around this, but I could be wrong.
public static final String google_project_id = ""null""; public static final String oauth_client_id = ""xxx""; public static final String oauth_client_secret = ""...""; public static final String oauth_redirect_uri = ""https://gitter.im/login/oauth/callback"";
@gtsiolis My
app/build/generated/source/buildConfig/debug/im/gitter/gitter/BuildConfig.java
looks the same and I am seeing the syntax errors.Have you tested it in CI? Copy
oauth_client_id
,oauth_client_secret
,oauth_redirect_uri
into your project settings -> CI / CD -> Variables to get the build goingCurrently the build is green and working AFAICT
Edited by Eric EastwoodSorry for responding late @MadLittleMods, I see exactly the same syntax errors but the build is failing locally. Indeed, pipeline passes when using the variables, but this should also build successfully locally to allow deployment on a device, right?
@gtsiolis Your changes build locally but fail in CI, ex. https://gitlab.com/gitlab-org/gitter/gitter-android-app/-/jobs/106224296
But perhaps we could just concat the necessary quotes where we set the properties from the environment variables, https://gitlab.com/gitlab-org/gitter/gitter-android-app/commit/9265e39bd3ecd7ac78ae517005dd2a861727dcd6. I went with this for now
@MadLittleMods the pipeline you linked to is running on the master on my fork. The pipeline for these changes running on the branch on my fork is passing and the changes build locally. However, the pipeline on the master now (including 9265e39b) on my fork is passing and changes build locally, too!
https://gitlab.com/gitlab-org/gitter/gitter-android-app/commit/9265e39bd3ecd7ac78ae517005dd2a861727dcd6 passes because I amended the commit with the changes I mentioned.
Compare https://gitlab.com/gitlab-org/gitter/gitter-android-app/commit/9265e39bd3ecd7ac78ae517005dd2a861727dcd6 with your MR https://gitlab.com/gitlab-org/gitter/gitter-android-app/merge_requests/4/diffs
It's all good now. Thanks for bringing this up
9265e39b passes because I amended the commit with the changes I mentioned.
You're totally right. Thanks again for making this clear @MadLittleMods!