Remove emoji from logs and downgrade noisy messages to DEBUG #81
Workflow file for this run
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: Build & Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build-and-test: | |
| runs-on: macos-15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: SwiftLint | |
| run: | | |
| brew install swiftlint | |
| swiftlint lint | |
| - name: List available simulators | |
| run: xcrun simctl list devices available | head -30 | |
| - name: Build | |
| run: | | |
| xcodebuild build \ | |
| -project Facett.xcodeproj \ | |
| -scheme Facett \ | |
| -destination "generic/platform=iOS Simulator" \ | |
| -quiet | |
| - name: Run Unit Tests | |
| run: | | |
| xcodebuild test \ | |
| -project Facett.xcodeproj \ | |
| -scheme Facett \ | |
| -destination "platform=iOS Simulator,name=iPhone 16" \ | |
| -only-testing:FacettTests/PacketReconstructorTests \ | |
| -only-testing:FacettTests/TLVParserTests \ | |
| -only-testing:FacettTests/ResponseMapperTests \ | |
| -only-testing:FacettTests/BLEParserPipelineTests \ | |
| -only-testing:FacettTests/GoProCommandTests \ | |
| -only-testing:FacettTests/SettingsTests \ | |
| -only-testing:FacettTests/StateMachineTests \ | |
| -only-testing:FacettTests/CameraSettingDescriptionTests \ | |
| -only-testing:FacettTests/ErrorHandlerTests \ | |
| -only-testing:FacettTests/CameraGroupTests \ | |
| -enableCodeCoverage YES \ | |
| -resultBundlePath TestResults.xcresult | |
| - name: Code Coverage Summary | |
| if: always() | |
| run: | | |
| if [ -d TestResults.xcresult ]; then | |
| xcrun xccov view --report --json TestResults.xcresult > coverage.json | |
| echo "## Code Coverage" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| python3 -c " | |
| import json, sys | |
| with open('coverage.json') as f: | |
| data = json.load(f) | |
| targets = data.get('targets', []) | |
| for t in targets: | |
| name = t.get('name', '') | |
| if name == 'Facett.app': | |
| pct = t.get('lineCoverage', 0) * 100 | |
| print(f'**{name}**: {pct:.1f}% line coverage') | |
| sys.stdout.flush() | |
| files = t.get('files', []) | |
| covered = [(f['name'], f['lineCoverage'] * 100) for f in files if f.get('lineCoverage', 0) > 0] | |
| covered.sort(key=lambda x: -x[1]) | |
| print() | |
| print('| File | Coverage |') | |
| print('|------|----------|') | |
| for fname, cov in covered[:20]: | |
| print(f'| {fname} | {cov:.1f}% |') | |
| " >> $GITHUB_STEP_SUMMARY | |
| fi |