Fix GitHub actions test script #78
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Swift Tests | |
| on: | |
| push: | |
| branches: | |
| - 'master' | |
| paths-ignore: | |
| - 'BlueConnect.podspec' | |
| - 'Banner.png' | |
| - 'README.md' | |
| - 'CHANGELOG.md' | |
| - 'LICENSE' | |
| - 'swift-generate-documentation.sh' | |
| - 'docs/**' | |
| - '.periphery.yml' | |
| - '.spy.yml' | |
| - '.swiftlint.yml' | |
| - '.gitignore' | |
| pull_request: | |
| branches: | |
| - '*' | |
| types: [opened, reopened] | |
| workflow_dispatch: | |
| jobs: | |
| tests: | |
| name: Swift ${{ matrix.swift }} on ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: macos-14 | |
| swift: "5.9" | |
| - os: macos-14 | |
| swift: "5.10" | |
| - os: macos-15 | |
| swift: "6.0" | |
| - os: macos-15 | |
| swift: "6.1" | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Setup swift version ${{ matrix.swift }} | |
| uses: swift-actions/setup-swift@v2 | |
| with: | |
| swift-version: ${{ matrix.swift }} | |
| - name: Check swift version | |
| run: swift --version | |
| - name: Repository checkout | |
| uses: actions/checkout@v4 | |
| - name: Build | |
| run: swift build | |
| - name: Select latest Xcode | |
| run: | | |
| LATEST_XCODE=$(ls /Applications | grep '^Xcode_' | sort -V | tail -n1) | |
| echo "Using $LATEST_XCODE" | |
| sudo xcode-select -s "/Applications/$LATEST_XCODE" | |
| - name: Run tests with xcodebuild | |
| run: | | |
| xcodebuild test \ | |
| -scheme BlueConnect \ | |
| -sdk macosx \ | |
| -destination 'platform=macOS' |