Skip to content

Any templates for same workflow, multiple virtual environments #27060

Answered by Simran-B
ajhalili2006 asked this question in Actions
Discussion options

You must be logged in to vote

Hi, did you find what you were looking for in the meantime? It’s not fully clear to me from your question what you look for, but it sounds like you want a single workflow to run with different runners (Ubuntu, macOS). That’s easily achievable with a job matrix:

on: push
jobs:
  job1:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
    steps:
      - name: Run this for all OSes
        run: |
          echo "os = ${{ matrix.os }}"
      - name: Run this on Linux only
        if: contains(matrix.os, 'ubuntu-')
        run: |
          echo "Linux only"
      - name: Run this on macOS only
        if: contains(matrix.os, 'macos-')
        r…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants