# Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch on: push: branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" build-and-test: # The type of runner that the job will run on runs-on: macos-latest
# Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2
- name: Select Xcode run: sudo xcode-select -switch /Applications/Xcode_12.4.app - name: Xcode version run: /usr/bin/xcodebuild -version - name: Build and Test run: xcodebuild -workspace Example/CCRegionSelector.xcworkspace -scheme CCRegionSelector-Unit-Tests CODE_SIGN_IDENTITY="" -configuration Debug CODE_SIGNING_REQUIRED=NO -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 12,OS=14.4" ONLY_ACTIVE_ARCH=YES test
同時為了 xcodebuild 比較好寫,可以把 CCRegionSelector-Unit-Tests 加到 Example 中的 Test 中,如圖下所示