I am new to CI/CD and I want to create a CI/CD pipeline on gitlab that compiles my code on:
So far, I have been doing it only on Linux using the following strategy:
Here is my .gitlab-ci.yml file:
stages:
- docker
- build
build_docker_image:
stage: docker
image: docker:20.10.16
before_script:
- docker login -u $REGISTRY_USER -p $REGISTRY_PASS
script:
- docker build -t "$REGISTRY_USER/my_dependencies:latest" .
- docker push "$REGISTRY_USER/my_dependencies:latest"
rules:
- changes:
- Dockerfile
build_and_test:
stage: build
image: "$REGISTRY_USER/my_dependencies:latest"
script:
- mkdir build
- cd build
- cmake ..
- make
artifacts:
paths:
- build/libtest.so
Now, i want to produce the shared libraries on MacOs and Windows. If I understood well, I cannot use Docker containers because they cannot use an osx or a windows base image, right ? I thought of using two virtual machines (osx and windows) and installing beforehand all the dependencies in each one. Is this a correct way ?
Thanks a lot and sorry for any ambiguities in my question, I am new to all this.
If you can find a way to build both the macOS and Windows versions on a Linux machine, that would likely be the simplest solution.
If that is not possible, your only three options are probably: