Building swift package for iOS specifically using Github actions

Viewed 546

I have swift package for iOS apps (it needs UIKit to run). I wan't to build this package using Github action this is how my workflow looks like

name: Swift

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:

    runs-on: macos-latest

    steps:
    - uses: actions/checkout@v2
    - uses: YOCKOW/Action-setup-swift@master
      with:
        swift-version: '5.3'
    - name: Build
      run: swift build -v
    - name: Run tests
      run: swift test -v

When I run this build I got error: no such module 'UIKit'.

So I have 2 options:

  1. make my package UIKit independent (actually don't know how)

  2. configure build to run on iOS specifically

What should I do?

1 Answers
Related