From 17398e7dc0b7ea115f17bbff722619f43b39388a Mon Sep 17 00:00:00 2001 From: Otavio Cordeiro Date: Thu, 18 Dec 2025 07:51:43 +0100 Subject: [PATCH] Add GitHub Action to Run Unit Tests --- .github/workflows/pr-checks.yml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 7f1c402..bd0111a 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -23,6 +23,17 @@ jobs: - name: Show Xcode 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 uses: actions/cache@v4 with: @@ -46,13 +57,12 @@ jobs: | xcpretty || exit 1 continue-on-error: false - - name: Install swiftformat - run: brew install swiftformat - - - name: Check code formatting + - name: Run OMG Tests run: | - swiftformat --lint . - if [ $? -ne 0 ]; then - echo "❌ Code formatting issues detected. Please run 'swiftformat .' locally to fix." - exit 1 - fi + xcodebuild test \ + -project OMG.xcodeproj \ + -scheme OMG \ + -configuration Debug \ + -destination 'platform=macOS' \ + | xcpretty || exit 1 + continue-on-error: false