Build matrix


#1

The main missing feature for us of CircleCI is matrix builds. These are useful for checking that your projects builds with e.g. multiple versions of a compiler. Or to check different combinations of build flags. It would be great to be able to divide builds into “jobs”, and have the UI report the failure/success of each job in a build. Each job would be a combination of environment variables / build settings.

The recommendation from CircleCI is to use parallelism for this. But,

  1. parallel containers are expensive
  2. you still don’t get independent failure reports (so it’s difficult to tell what fails and what doesn’t)
  3. manually dispatching on $CIRCLE_NODE_INDEX is verbose and error prone.

Multiple builds from the same branch
Multiple YAML files for cross-platform projects and easier test matrix configuration
Support for Multiple OSs
Multiple php versions build matrix
Using CircleCI to set Rubygems Credentials
#2


This may be a usable workaround in the meantime. I haven’t tested it myself though.


#3

I was just going to investigate how this was handled in circleci.

@drazisil, could you add a link to the post or web page that gives the instructions on how to use parallelism to solve this. For me I simply need to set a “global” environment variable to different values so maybe it will work for me. I’ll take a look at Michael’s circleci suggestion.

Thanks for requesting this feature.


#4

So I looked at Michael’s code and it will do what I need. I’ve made some changes here if anyone’s interested and have offered it as a pull request to Michael.


#5

Looks great, glad it helped! :smile:


#6

As additional input into this feature request, I have the issue of wanting to run unittests for an app and run fuller selenium based integration tests both at PR time.

I’d like unit test results to come back quick so that developers can make amendments, or push files they’ve forgotten to - and the selenium test results would run and update the commit result upon completion

At the moment we have to chain the build (the unittest run triggers the selenium run), but if the selenium test run fails we are not notified.


#7

everybody lacks matrix( and there’s nothing yet until now.
I’ve made circleci-helpers with environment matrix (1 dimension), please check it out might be helpful https://github.com/dennybaa/circleci-helpers


#8

An easy solution is to use tox (http://tox.readthedocs.io/en/latest/) which is a generic, robust test runner and supports build matrices.


#9

We are enabling first class support for running multiple jobs for CircleCI 2.0. Right now we are adding a limited number of customers. If you are interested in trying out, please reach out at beta+workflows@circleci.com with your VCS organization and repository name.
Thanks!


#10

This can be done today using [Workflows] (https://circleci.com/docs/2.0/workflows/). Please reach out if you are facing issues.


#11

For an example of a build matrix config file using workflows on CircleCI 2.0, please see this post.


#12