title: GitHub Actions: How to run `services` on Windows or macOS?
body: <p>I want to test a CLI that should connect to PostgreSQL and MySQL servers using GitHub Actions, on all platforms if possible: Linux, Windows and macOS.</p>
  
  <p>I found instructions on <a href="https://github.com/actions/example-services/blob/master/.github/workflows/postgres-service.yml" rel="noreferrer">how to run a Postgres <code>service</code></a> and <a href="https://itnext.io/github-actions-ci-configuration-for-ruby-on-rails-project-with-mysql-redis-elasticsearch-how-82ed417e3a3d" rel="noreferrer">how to run a MySQL <code>service</code></a> and <a href="https://github.com/janpio/github-action-services-test/blob/master/.github/workflows/test.yml" rel="noreferrer">combined these into a workflow</a>:</p>
  
  <pre><code>name: Test
  on: [push]
  
  jobs:
  
      init_flow:
          name: 'Run MySQL and Postgres on ${{ matrix.os }}'
          runs-on: ${{ matrix.os }}
          strategy:
              fail-fast: false
              matrix:
                  os: [ubuntu-latest, windows-latest, macOS-latest]
  
          # via https://github.com/actions/example-services/blob/master/.github/workflows/postgres-service.yml
          services:
              postgres:
                  image: postgres:10.8
                  env:
                      POSTGRES_USER: postgres
                      POSTGRES_PASSWORD: postgres
                      POSTGRES_DB: postgres
                  ports:
                  # will assign a random free host port
                  - 5432/tcp
                  # needed because the postgres container does not provide a healthcheck
                  options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
              mysql:
                  image: mysql:5.7
                  env:
                      MYSQL_ROOT_PASSWORD: root
                  ports:
                  - 3306
                  options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
  
          steps:
              - uses: actions/checkout@v1
              - run: node -v
                env:
                  # use localhost for the host here because we are running the job on the VM.
                  # If we were running the job on in a container this would be postgres
                  POSTGRES_HOST: localhost
                  POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port
                  MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
  </code></pre>
  
  <p>But this only seems to work on Linux, not Windows or macOS, see the results of the action on GitHub:</p>
  
  <ul>
  <li><a href="https://github.com/janpio/github-action-services-test/runs/257915015" rel="noreferrer">Linux ✔</a></li>
  <li><a href="https://github.com/janpio/github-action-services-test/runs/257915022" rel="noreferrer">Windows ❌</a></li>
  <li><a href="https://github.com/janpio/github-action-services-test/runs/257915029" rel="noreferrer">macOS ❌</a></li>
  </ul>
  
  <p>Windows fails during <code>Initialize Containers</code> with <code>##[error]Container operation is only supported on Linux</code>, macOS even during <code>Set up job</code> with <code>##[error]File not found: 'docker'</code>. </p>
  
  <p><a href="https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idservices" rel="noreferrer">GitHub Actions <code>services</code> docs</a> do not mention that this will only work on Linux, but I also do not know much about containers or Docker so might be missing something obvious.</p>
  
  <p>(It is not important that MySQL and PostgreSQL run on the same operating system by the way - they only have to be accessible by the main job.)</p>
  
  <p>Is it possible to run MySQL and PostgreSQL for GitHub Actions using Windows and macOS?<br>
  If not, what is the best workaround here?</p>