kotlin-inject icon indicating copy to clipboard operation
kotlin-inject copied to clipboard

Add GitHub actions

Open ArthurKun21 opened this issue 7 months ago • 1 comments

Hello

was thinking of checking kotlin-inject for migration of my android project into KMP and then I saw https://github.com/evant/kotlin-inject/discussions/486 and figured I can do the simple stuff of building initial setup of Github actions and let you take care of the publishing and other complex stuff.

Admittedly I do not know the other stuff and I only did what I know that I can do


Changes made with this PR

  • Enabled build whenever there is a push on the main branch or in a pull_request. Can also manually building at the actions tab
  • Made the concurrency to cancel other build if done not on the main branch
  • Setup a matrix so the macos and ubuntu can run in parallel.
    • Also added fail-fast: false so if the other fails it won't immediately result in the other to be cancel out due to the build failure
  • Did not explicitly added the chrome and chrome drivers as it is already on the runner-images
    • https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#browsers-and-drivers
    • https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#browsers
  • Make use of git hash for the version control of github actions for security
  • Added ability to ignore when you update a markdown and the gitignore
  • gradle-wrapper-validation for validating you got true gradle wrapper https://github.com/gradle/actions/blob/main/docs/wrapper-validation.md#gradle-wrapper-validation-action
  • setup-gradle was added so you can cache the build. By default it will only cache the default branch and other branches will only be a read only to it https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#using-the-cache-read-only

I also made another workflow for lint check. This one will always run on all of the commits in the pull request and pushes to main branch

I personally like the separation of the build and a lint check so that you could track each separately


I did not add dependabot as you might be thinking of other ci for example like renovate but if you do this is the simple code for it

.github/dependabot.yml

version: 2
updates:
  - package-ecosystem: "gradle" 
    directory: "/"
    schedule:
      interval: "daily"

ArthurKun21 avatar May 21 '25 01:05 ArthurKun21

oh thanks, will take a look! may run these in parallel for a while to see if github actions is more reliable

evant avatar May 21 '25 21:05 evant