How to organise building across multiple compilers

Hi,

I need to build and test my C++ project using multiple compilers. I currently just have a single step that does cmake, make, ctest and a single agent connected in to process it. I then have two pipelines, one builds in Debug mode and the other in Release.

I am unsure of what the best practice is for BuildKite? Should I have a single step with lots of different agents connected in with their own compilers set up? Should I make many steps that are all the same but have agent queue tags for requiring different compilers?

Many thanks in advance

Peter

:wave: Hey @PeterBygrave - sorry for the late reply to this one!

Yeah - that’s how I would go. You could also use YAML anchors to make it a little easier.

Here’s an example that you could work from:

shared_build_step: &function
  command: "cmake && make && ctest"

steps:
  - <<: *shared_build_step
    agents:
      compiler: "compiler-1"

  - <<: *shared_build_step
    agents:
      compiler: "compiler-2"

  - <<: *shared_build_step
    agents:
      compiler: "compiler-3"

Another way is to have all the compilers installed on all the agents, and then in change a COMPILER environment variable - then dynamically choose the right compiler in your build scripts.

I hope that helps! And sorry again for the late reply!