Skip to content

Convert from Travis CI to GitHub Actions #2

Convert from Travis CI to GitHub Actions

Convert from Travis CI to GitHub Actions #2

Workflow file for this run

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