Skip to content
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

Introduce Github Actions #30

Merged
merged 1 commit into from Jan 6, 2022
Merged

Introduce Github Actions #30

merged 1 commit into from Jan 6, 2022

Conversation

tatocaster
Copy link
Contributor

@tatocaster tatocaster commented Jan 6, 2022

This change aims to introduce Github Action in the project - issue: #29

Requirements:

  • Have all unit tests and Android tests run when someone opens a PR.
  • If any of the tests fail, then the PR should be blocked.
  • Document is a way (i.e. on your PR) how this automation works.

How it works?

  • Runs on every pull request on the target branch: "main"

Steps are:

  • Checkout
  • Gradle wrapper validation - From the security perspective it is always good to check if the binary we download is trustful, in that case, it checks the checksum
  • Grants execution permission to Gradle
  • Runs all unit tests in all modules - ./gradlew test
  • Sets up an emulator with the API level 29 and runs all instrumented tests in all modules against the emulator - ./gradlew connectedAndroidtest

How to set up branch protection and mergeability of PR?

  • Enable status checks in repository settings, Github docs with images.
  • Settings -> Actions tab -> "allow all actions". "Allow select actions" is much better but a bit hassle to update every time. Opt-in at your convenience.
  • Settings -> Actions tab -> "Read repository contents permission", feels safer. It will protect the project if some contributors accidentally misuse any step from the action.

Future suggestions:

  • add lint checks
  • OWASP dependency check to check all the dependencies against the common vulnerabilities

Run tests with JDK 11 on PR
@alexstyl
Copy link
Owner

alexstyl commented Jan 6, 2022

Nice one. I added the protection rules to main and allowed all actions for now.

Is there anything left to do other than merge this to main @tatocaster ?

@tatocaster
Copy link
Contributor Author

Nothing else, we can merge it safely.

Thanks 🙏

@alexstyl alexstyl merged commit 0f33834 into alexstyl:main Jan 6, 2022
@alexstyl
Copy link
Owner

alexstyl commented Jan 6, 2022

This is phenomenal. Thanks for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants