Setup gitlab CI for project with KMM

I am working on adding gitlab CI for the project withKMM, the process for my setup is like below:

Setup gitlab CI for project with KMM
A chameleon out to bask in the sun

I am working on adding gitlab CI for the project withKMM, the process for my setup is like below:

Install gitlab-runner on a mac machine, and register the gitlab-runner on the gitlab, the gitlab-runner was configured with shell executor.

But in my project, it always report build error for iOS app, but when I run the command on the mac machine, it can build success, after testing for several times, I find that the gitlab-runner will reinitiate the working dir, it will remove all the created files and dirs, then running the build script, so I also try to clean the files and dirs before build the project, it really report the same error, it report that the shared module does no exists, but when I running the second time, it can build.

Solution

After investigate the logs and I find that the problem is that I need call the following commands before install the Podfile.

./gradlew :shared:podspec 
..gradlew :shared:podGenIOS

After add the commands above to the .gitlab-ci.yml , the project can build successfully.