diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml new file mode 100644 index 0000000..97b8988 --- /dev/null +++ b/.github/workflows/swift.yml @@ -0,0 +1,28 @@ +name: Swift + +on: [push] + +jobs: + build: + + runs-on: macOS-latest + strategy: + matrix: + destination: ['platform=iOS Simulator,OS=13.1,name=iPhone 11'] + xcode: ['/Applications/Xcode_12.app/Contents/Developer'] + steps: + - uses: actions/checkout@v1 + # Github Actions' machines do in fact have recent versions of Xcode, + # but you may have to explicitly switch to them. We explicitly want + # to use Xcode 12, so we use xcode-select to switch to it. + - name: Switch to Xcode 12 + run: sudo xcode-select --switch /Applications/Xcode_12.app + # Since we want to be running our tests from Xcode, we need to + # generate an .xcodeproj file. Luckly, Swift Package Manager has + # build in functionality to do so. + - name: Generate xcodeproj + run: swift package generate-xcodeproj + # Finally, we invoke xcodebuild to run the tests on an iPhone 11 + # simulator. + - name: Run tests + run: xcodebuild test -destination 'name=iPhone 11' -scheme 'ObjectUI-Package'