How to configure an action to execute on both, a self-hosted mac and self-hosted windows ?

I have some cross platform browser tests I need to run for browsers in both a mac osx and a windows 10 environment.

I have setup self-hosted runner for each environment. Is it possible to specify tine the “runs-on:”  in a single yml action file to run the described action on both runners at the same time?

Would something like this work?
runs-on: [self-hosted, [macos, windows]]

or should i specify something further down in the strategy section like this:

runs-on: [self-hosted]

strategy:

   matrix: 

        os: [macos, windows] 

For windows, the runner is actually in  WSL  so I know the windows label wont work, in this case I need to specify linux?  or ubuntu-18.04 of wsl?

Hi @ivanixgames ,

Github supports customer label now, you can add unique custom label for each runner, and use below code to execute on both self-hosted runners.

jobs:
  job1:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os:
          - label-1 # macos runner
          - label-2 # windows runner
    steps:

Selfhosted runner at same time.png

Thanks.

1 Like

Hi @ivanixgames ,

Thanks for your kudos mark. Confirmed on my repo, the label ‘windows’ can work fine.

It doesn’t accept ‘runs-on: [self-hosted, [macos, windows]]’ or define hardcode self-hosted in matrix, please follow my sample for your code.

Is there any other question in the ticket? 

Hi @weide-zhou ,
Thanks again for your suggestion to use custom label in os tag. This should fit the bill!

No other issues.