Cirrus-ci-docs: Run tests on all supported platforms?

Created on 19 Mar 2019  路  6Comments  路  Source: cirruslabs/cirrus-ci-docs

Question

I'm trying to figure out how to use Cirrus CI for testing a single project on all of:

  • FreeBSD
  • Linux
  • macOS
  • Windows

However, the examples don't seem to cover using even two platforms simultaneously, and searching online hasn't really provided much help.

Where do I even start?

question

All 6 comments

Hey @duckinator ,

To use different OSes in parallel, it depends on if you want to do it in the same task, or different tasks.

If you want to do it in the same task, matrix modifications can help out a ton. You can read up here. An example could be:

test_task:
  # note: the images specified here may not work, this is just a proof of concept 
  matrix:
    # DockerLinux:
    - container:
       image: coolimage:verson
    # macOS:
    - osx_instance:
       image: Mojave_xcode_10.13
    # windows:
    - windows_instance:
       image: windowsservercore
  script: ./dowhatever.sh

Or in different tasks:

 macOS_test_task:
  osx_instance:
    image: somemacimage

and so on, so forth.
If this doesn't fully answer your question, don't hesitate to leave me a reply :)

P.S. all images mentioned here were made up and may not work, see different guides for what images you can use: macOS, FreeBSD, Windows (DockerLinux is just any name of any Docker image you want to use)

Hey @duckinator, you can define multiple tasks in a single .cirrus.yml file like in an example here. You'll end up with something like:

task:
  name: Tests (Linux)
  container:
    image: ...
  tests_script: ...

task:
  name: Tests (Windows)
  windows_container:
    image: ...
  tests_script: ...

task:
  name: Tests (FreeBSD)
  freebsd_instance:
    image: ...
  tests_script: ...

task:
  name: Tests (macOS)
  osx_instance:
    image: ...
  tests_script: ...

Why doesn't GitHub show if someone is already typing! 馃槄Thank you, @RDIL!

I know right

Ah, okay! Looks like I had read all the relevant bits but it just didn't click that they could be combined like that. Thanks. :sweat_smile:

Cool! Please let us know if you'll have any other questions/issues. 馃檶

Was this page helpful?
0 / 5 - 0 ratings

Related issues

januswel picture januswel  路  4Comments

cjdb picture cjdb  路  5Comments

cevich picture cevich  路  5Comments

iskakaushik picture iskakaushik  路  5Comments

aslushnikov picture aslushnikov  路  5Comments