GitHub Actions构建矩阵中Mac特定的步骤

时间:2020-07-07 22:18:05

标签: github-actions

我是GitHub Actions的新手,并且我试图建立一个在不同平台上安装不同系统要求的构建矩阵。从https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml的示例中,我了解了如何编写仅在Windows上运行的步骤:

Error 400: redirect_uri_mismatch
The redirect URI in the request, http://taoofthemind.com/wp-login.php, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/1063798402436-i1gsqc12jqmfvjc64u0ra5hgk48hkrpn.apps.googleusercontent.com?project=1063798402436

或Linux

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

但是,如果我尝试 - name: Install system dependencies if: runner.os == 'Linux' ,则在Mac OS上将跳过我的步骤。所以我的问题是

  1. 在Mac OS中我使用什么if: runner.os == 'Mac'名称,
  2. 我在哪里可以查阅可能的runner.os名称列表?

1 个答案:

答案 0 :(得分:1)

macOS是您要寻找的:

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

您可以在runner context doc中引用不同的os类型。