mxcl / xcodebuild

A continuously resilient `xcodebuild` “GitHub Action”. Also it’s the best.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide an action that outputs the matrix for requested Swift/Xcodes

mxcl opened this issue · comments

https://github.blog/changelog/2020-04-15-github-actions-new-workflow-features/

So the action might look like:

jobs:
  foo:
    runs-on: ubuntu-latest
    outputs:
      matrix: ${{ steps.xcode-matrix.outputs.matrix }}
    steps:
    - uses: mxcl/xcode-matrix
      id: xcode-matrix
      with:
        swift: 5.0 5.1 5.2 5.3 5.4 5.5

And then can be consumed in a subsequent job:

jobs:
  bar:
    needs: foo
    strategy:
      matrix: ${{ jobs.foo.outputs.matrix }}
    runs-on: ${{ matrix.os }}
    steps:
      - uses: mxcl/xcodebuild
        with:
          xcode: ${{ matrix.xcode }}

Note this requires the action to have JSON files on versions that are generated daily via a scheduled workflow since we cannot determine the matrix inside any particular runs-on image. Hence the above uses ubuntu.

Note not sure how to do eg. platform matrix this way.