Add GitHub Action to Run Unit Tests

This commit is contained in:
Otavio Cordeiro 2025-12-18 07:51:43 +01:00
parent 2cae75f8c6
commit 6dc6132f36

View file

@ -23,6 +23,17 @@ jobs:
- name: Show Xcode version - name: Show Xcode version
run: xcodebuild -version run: xcodebuild -version
- name: Install swiftformat
run: brew install swiftformat
- name: Check code formatting
run: |
swiftformat --lint .
if [ $? -ne 0 ]; then
echo "❌ Code formatting issues detected. Please run 'swiftformat .' locally to fix."
exit 1
fi
- name: Cache Swift Package Manager - name: Cache Swift Package Manager
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
@ -46,13 +57,12 @@ jobs:
| xcpretty || exit 1 | xcpretty || exit 1
continue-on-error: false continue-on-error: false
- name: Install swiftformat - name: Run OMG Tests
run: brew install swiftformat
- name: Check code formatting
run: | run: |
swiftformat --lint . xcodebuild test \
if [ $? -ne 0 ]; then -project OMG.xcodeproj \
echo "❌ Code formatting issues detected. Please run 'swiftformat .' locally to fix." -scheme OMG \
exit 1 -configuration Debug \
fi -destination 'platform=macOS' \
| xcpretty || exit 1
continue-on-error: false