

To start with, GitLab CI requires repos to have a file named. More specifically, the only:changes feature makes it quite easy to implement the aforementioned logic of running specific tasks based on the directory of the change. There are plenty of CI solutions available such as Travis CI, CircleCI and GitLab CI, but after a quick investigation I think that GitLab CI is the best available option for this kind of implementation. Ideally what I would like to achieve is that each time we push some code on the androidApp directory to run only the Android app related tasks, every time we push something on the iosApp directory to run the iOS related tasks and when something is changed on the shared directory to run all the tasks (tests and code styling on the shared library, Android and iOS) This project is also available on GitHub and Gitlab. Long story short, in this post I will try to document the steps that I took to setup a continuous integration solution to run unit tests and coding style tools for an iOS and an Android app built with Kotlin Multiplatform Project.įor the purposes of this post I will make use of the project created on the previous posts related to Kotlin Multiplatform Project, about setting up a project, applying some changes in the default structure, setting up unit tests and setting up code styling tools. when checking in new code) and when something is failing to notify us, so that we can take the proper actions. This applies to our scenario too it will increase the possibility of actually following these practices if it was super easy and not our responsibility to remember to run them every single time.Īnd that’s exactly what Continuous Integration is all about to develop pipelines of tasks that will be executed on predefined triggers (e.g. The cause can vary from case to case be it that we just forget it, laziness or reasons that led us to put these efforts aside in an attempt to increase speed and velocity.Īs with every attempt to form a habit, it is important to make is as easy as possible to commit to this habit. How many times have you started a project with the intent to follow practices such as writing unit tests and enforcing a code style, only to give up after a while?ĭespite all the initial good will and motivation, having another task to remember and perform every time we make a code change, makes it harder and harder to stay consistent and follow these practises for a long time.
