landau
landau

Reputation: 5841

Mac-specific steps in a GitHub Actions build matrix

I am new to GitHub Actions, and I am trying to set up a build matrix that installs different system requirements on different platforms. From the example at https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml, I figured out how to write steps that only run on Windows:

      - name: step name
        if: runner.os == 'Windows'

or Linux

      - name: Install system dependencies
        if: runner.os == 'Linux'

But if I try if: runner.os == 'Mac', my step gets skipped on Mac OS. So my questions are

  1. What runner.os name do I use for Mac OS, and
  2. Where can I refer to the list of possible runner.os names?

Upvotes: 1

Views: 1302

Answers (1)

chenrui
chenrui

Reputation: 9866

macOS is what you looking for:

- name: doing something on macOS
  if: runner.os == 'macOS'

You can refer the different os type in runner context doc.

Upvotes: 3

Related Questions