Android Lint workflow using Github Actions

Lets create workflow which will run lint code inspector on every pull request created on main branch and when code is pushed to main branch.

Create a .github folder and then workflows folder inside like that .github/workflows .

We write Github workflows in yml file, creating an empty android-lint.yml file inside .github/workflows .

Then set the name of the workflow as below.

We want to run workflow when code is pushed or a pull request is created from main branch.

Running actual job on workflow

It defines a job named android-lint and configures it to run on ubuntu-latest, that means it will run on linux runner hosted by Github.

Next to create steps inside the job, first we have to checkout the code using Github action actions/checkout@v3 as below.

Setting-up JDK version 17

Run Android Lint.

It will run Android Linter as soon as we create a pull request for main branch or when code is pushed to main branch.

The complete android-lint.yml file is below.

That’s it for now. I hope it was helpful.

Source link