Skip to content

Support Swift 6

Support Swift 6 #149

Workflow file for this run

name: Xcode Build & Test
on:
workflow_dispatch:
push:
branches: [ tretnfckit-main ]
pull_request:
branches: [ tretnfckit-main ]
env:
SCHEME_NAME: TRETNFCKit-Package
IOS_SIMULATOR_NAME: iPhone 15 Pro
TVOS_SIMULATOR_NAME: Apple TV 4K (3rd generation)
WATCHOS_SIMULATOR_NAME: Apple Watch Ultra 2 (49mm)
VISIONOS_SIMULATOR_NAME: Apple Vision Pro
XCODE_SELECT_PATH: '/Applications/Xcode_16_beta_6.app/Contents/Developer'
jobs:
show_software_information:
name: Show software information
strategy:
fail-fast: false
matrix:
os: [macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Show Xcode list
run: ls -n /Applications | grep 'Xcode'
- name: Show the default version of Xcode
run: xcodebuild -version
- name: Set Xcode version
run: sudo xcode-select -s '${{ env.XCODE_SELECT_PATH }}'
- name: Show lists the targets and configurations in a project, or the schemes in a workspace
run: xcodebuild -list
- name: Show a list of destinations
run: xcodebuild -scheme ${{ env.SCHEME_NAME }} -showdestinations
xcodebuild:
name: Xcode Build & Test
strategy:
fail-fast: false
matrix:
os: [macos-14]
platform: ['iOS', 'macOS-x86_64', 'macOS-arm64', 'macCatalyst-x86_64', 'macCatalyst-arm64', 'tvOS', 'watchOS', 'visionOS']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set Xcode version
run: sudo xcode-select -s '${{ env.XCODE_SELECT_PATH }}'
- name: Build the scheme
run: |
case ${{ matrix.platform }} in
'iOS' ) xcodebuild -scheme ${{ env.SCHEME_NAME }} -destination 'name=${{ env.IOS_SIMULATOR_NAME }}' | tee xcodebuild-${{ matrix.os }}-${{ matrix.platform }}.log && exit ${PIPESTATUS[0]} ;;
'macOS-x86_64' ) xcodebuild -scheme ${{ env.SCHEME_NAME }} -destination 'platform=macOS,arch=x86_64' | tee xcodebuild-${{ matrix.os }}-${{ matrix.platform }}.log && exit ${PIPESTATUS[0]} ;;
'macCatalyst-x86_64' ) xcodebuild -scheme ${{ env.SCHEME_NAME }} -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' | tee xcodebuild-${{ matrix.os }}-${{ matrix.platform }}.log && exit ${PIPESTATUS[0]} ;;
'macOS-arm64' ) xcodebuild -scheme ${{ env.SCHEME_NAME }} -destination 'platform=macOS,arch=arm64' | tee xcodebuild-${{ matrix.os }}-${{ matrix.platform }}.log && exit ${PIPESTATUS[0]} ;;
'macCatalyst-arm64' ) xcodebuild -scheme ${{ env.SCHEME_NAME }} -destination 'platform=macOS,arch=arm64,variant=Mac Catalyst' | tee xcodebuild-${{ matrix.os }}-${{ matrix.platform }}.log && exit ${PIPESTATUS[0]} ;;
'tvOS' ) xcodebuild -scheme ${{ env.SCHEME_NAME }} -destination 'name=${{ env.TVOS_SIMULATOR_NAME }}' | tee xcodebuild-${{ matrix.os }}-${{ matrix.platform }}.log && exit ${PIPESTATUS[0]} ;;
'watchOS' ) xcodebuild -scheme ${{ env.SCHEME_NAME }} -destination 'name=${{ env.WATCHOS_SIMULATOR_NAME }}' | tee xcodebuild-${{ matrix.os }}-${{ matrix.platform }}.log && exit ${PIPESTATUS[0]} ;;
'visionOS' ) xcodebuild -scheme ${{ env.SCHEME_NAME }} -destination 'name=${{ env.VISIONOS_SIMULATOR_NAME }}' | tee xcodebuild-${{ matrix.os }}-${{ matrix.platform }}.log && exit ${PIPESTATUS[0]} ;;
esac
- name: Upload Xcode Build log
if: always()
uses: actions/upload-artifact@v4
with:
name: xcodebuild log (${{ matrix.os }}, ${{ matrix.platform }})
path: |
xcodebuild-${{ matrix.os }}-${{ matrix.platform }}.log
- name: Test the scheme
run: |
case ${{ matrix.platform }} in
'iOS' ) xcodebuild test -scheme ${{ env.SCHEME_NAME }} -destination 'name=${{ env.IOS_SIMULATOR_NAME }}' -resultBundlePath TestResults-${{ matrix.os }}-${{ matrix.platform }} ;;
'macOS-x86_64' ) xcodebuild test -scheme ${{ env.SCHEME_NAME }} -destination 'platform=macOS,arch=x86_64' -resultBundlePath TestResults-${{ matrix.os }}-${{ matrix.platform }} ;;
'macCatalyst-x86_64' ) xcodebuild test -scheme ${{ env.SCHEME_NAME }} -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' -resultBundlePath TestResults-${{ matrix.os }}-${{ matrix.platform }} ;;
'macOS-arm64' ) xcodebuild test -scheme ${{ env.SCHEME_NAME }} -destination 'platform=macOS,arch=arm64' -resultBundlePath TestResults-${{ matrix.os }}-${{ matrix.platform }} ;;
'macCatalyst-arm64' ) xcodebuild test -scheme ${{ env.SCHEME_NAME }} -destination 'platform=macOS,arch=arm64,variant=Mac Catalyst' -resultBundlePath TestResults-${{ matrix.os }}-${{ matrix.platform }} ;;
'tvOS' ) xcodebuild test -scheme ${{ env.SCHEME_NAME }} -destination 'name=${{ env.TVOS_SIMULATOR_NAME }}' -resultBundlePath TestResults-${{ matrix.os }}-${{ matrix.platform }} ;;
'watchOS' ) xcodebuild test -scheme ${{ env.SCHEME_NAME }} -destination 'name=${{ env.WATCHOS_SIMULATOR_NAME }}' -resultBundlePath TestResults-${{ matrix.os }}-${{ matrix.platform }} ;;
'visionOS' ) xcodebuild test -scheme ${{ env.SCHEME_NAME }} -destination 'name=${{ env.VISIONOS_SIMULATOR_NAME }}' -resultBundlePath TestResults-${{ matrix.os }}-${{ matrix.platform }} ;;
esac
- uses: kishikawakatsumi/xcresulttool@v1
with:
path: TestResults-${{ matrix.os }}-${{ matrix.platform }}.xcresult
title: Xcode test results (${{ matrix.os }}, ${{ matrix.platform }})
if: success() || failure()
- name: Upload Xcode DerivedData
if: always()
uses: actions/upload-artifact@v4
with:
name: Xcode DerivedData (${{ matrix.os }}, ${{ matrix.platform }})
path: |
/Users/runner/Library/Developer/Xcode/DerivedData