-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize GitHub Actions Workflow for Android CI #16
Conversation
add google-services.json in workflow allow manual triggering of workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Basler182; I added some additional context about the secrets in the Slack discussion.
Co-authored-by: Paul Schmiedmayer <PSchmiedmayer@users.noreply.github.com>
@@ -24,6 +26,11 @@ jobs: | |||
distribution: 'temurin' | |||
cache: gradle | |||
|
|||
- name: Decode and write google service json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, we can reuse steps by defining a yaml anchor before, e.g before jobs:
firebase-setup: &firebase-setup
- name: Decode and write google service json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $GOOGLE_SERVICES_JSON | base64 --decode >./app/google-services.json
and reuse it here: - <<: *firebase-setup
and in other jobs.
Also, we need to inject the json only for jobs that require a project build (gradlew build
). Do dokka, lint and test depend on build? Maybe test yes, but not sure whether it is needed for the others
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a really cool idea; I have not used that before.
Unfortunately, according to this issue actions/runner/#1182 this syntax doesn't seem to be supported in the GitHub Action YAML.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had also assumed that only build and test needed the google json, but the github action only went through when I added the google-services.json at every single step
@Basler182 Let us know if you need any additional input here and how you can integrate this in some of the improvements on main if needed 👍 |
the file got deleted meanwhile, i ll create a new PR |
# Setup Android Tests CI Setup ## ♻️ Current situation & Problem - Addresses #16 - Closes #21 ## ⚙️ Release Notes - Setup Android Tests CI Setup ## ☑️ Remaining Issues - [x] Report Code Coverage: I have build the rough setup for running the tests but the code coverage report currently doesn't work as expected for the Android tests. Codecov seems to merge reports for the same commit so we can just upload them all in different builds. Would be amazing if you can take a look at this @eldcn - [x] Contact Tests Fail: It seems like the contact Android tests fail locally and on the CI. Good as a test for the setup, would be great if we can fix them as part of this PR @Basler182 ## 📝 Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md). --------- Co-authored-by: Eldi Cano <eldi.cano@hotmail.com>
Optimize GitHub Actions Workflow for Android CI
♻️ Current situation & Problem
Link any open issues or pull requests (PRs) related to this PR. Please ensure that all non-trivial PRs are first tracked and discussed in an existing GitHub issue or discussion.
📚 Documentation
📝 Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: