Skip to content

Commit

Permalink
Allow specifying runner
Browse files Browse the repository at this point in the history
  • Loading branch information
shichen85 committed May 3, 2024
1 parent 830408a commit 156e2d9
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,46 @@ on:
runtime:
description: 'Target runtime'
required: false
runner:
description: 'Runner'
required: false
default: 'macOS-latest'
workflow_call:
inputs:
runtime:
description: 'Target runtime'
required: false
type: string
runner:
description: 'Runner'
required: false
default: 'macOS-latest'
type: string
permissions:
contents: write

env:
MATRIX_STRING: '[\"windows-latest\",\"ubuntu-latest\", \"macOS-latest\"]'

jobs:
runner:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- if: ${{ inputs.runner }}
run: echo "MATRIX_STRING=[\\\"${{ github.event.inputs.runner }}\\\"]" >> $GITHUB_ENV
- id: set-matrix
run: echo "matrix=${{ env.MATRIX_STRING }}" >> $GITHUB_OUTPUT

test:
needs: runner
runs-on: ${{ matrix.os }}
# runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
os: ${{ fromJSON(needs.runner.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
with:
Expand Down

0 comments on commit 156e2d9

Please sign in to comment.