Initial commit #2
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: CI | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| name: Build and Test | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer | |
| - name: Show Xcode version | |
| run: xcodebuild -version | |
| - name: Show available destinations | |
| run: xcodebuild -project "Stay Tuned/Stay Tuned.xcodeproj" -scheme "Stay Tuned" -showdestinations | |
| - name: Build | |
| run: | | |
| xcodebuild build \ | |
| -project "Stay Tuned/Stay Tuned.xcodeproj" \ | |
| -scheme "Stay Tuned" \ | |
| -destination "platform=iOS Simulator,name=iPhone 15,OS=17.5" \ | |
| -configuration Debug \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| | xcpretty --color | |
| - name: Run Unit Tests | |
| run: | | |
| xcodebuild test \ | |
| -project "Stay Tuned/Stay Tuned.xcodeproj" \ | |
| -scheme "Stay Tuned" \ | |
| -destination "platform=iOS Simulator,name=iPhone 15,OS=17.5" \ | |
| -configuration Debug \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| -resultBundlePath TestResults.xcresult \ | |
| | xcpretty --color --report junit --output test-results.xml | |
| - name: Upload Test Results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: | | |
| test-results.xml | |
| TestResults.xcresult | |
| retention-days: 30 | |
| lint: | |
| name: Swift Lint | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install SwiftLint | |
| run: brew install swiftlint | |
| - name: Run SwiftLint | |
| run: swiftlint lint --reporter github-actions-logging "Stay Tuned/Stay Tuned" | |
| continue-on-error: true | |