Convert from Travis CI to GitHub Actions #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: [ master, main ] | |
| pull_request: | |
| branches: [ master, main ] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| destination: | |
| - platform=macOS,arch=x86_64 | |
| - platform=iOS Simulator,name=iPhone 15,OS=latest | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Show Xcode version | |
| run: xcodebuild -version | |
| - name: List available schemes | |
| run: xcodebuild -list | |
| - name: Run tests | |
| run: | | |
| xcodebuild \ | |
| -scheme "hsluv-objc" \ | |
| -destination "${{ matrix.destination }}" \ | |
| -enableCodeCoverage YES \ | |
| -derivedDataPath DerivedData \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| test | |
| - name: Generate test report | |
| if: always() | |
| run: | | |
| xcrun xccov view --report --json DerivedData/Logs/Test/*.xcresult > coverage.json || true | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-${{ strategy.job-index }} | |
| path: | | |
| DerivedData/Logs/Test/ | |
| coverage.json | |
| retention-days: 30 |