From d3b596c26faee1fe5d59ace5c4821f9f21ebcc4c Mon Sep 17 00:00:00 2001 From: Otavio Cordeiro Date: Tue, 13 Jan 2026 12:23:30 -0300 Subject: [PATCH] Split GitHub Actions in separate files --- .github/workflows/build.yml | 47 +++++++++++++++++++ .github/workflows/swiftformat.yml | 27 +++++++++++ .../{pr-checks.yml => unit-tests.yml} | 27 ++--------- 3 files changed, 77 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/swiftformat.yml rename .github/workflows/{pr-checks.yml => unit-tests.yml} (61%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..bf26ba9 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +name: Build + +on: + pull_request: + branches: + - main + - develop + +jobs: + build: + name: Build OMG + runs-on: macos-26 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Select Xcode version + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '26.1.1' + + - name: Show Xcode version + run: xcodebuild -version + + - name: Cache Swift Package Manager + uses: actions/cache@v4 + with: + path: | + .build + ~/Library/Developer/Xcode/DerivedData + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-spm- + + - name: Resolve Swift Package dependencies + run: xcodebuild -resolvePackageDependencies -project OMG.xcodeproj -scheme OMG + + - name: Build OMG + run: | + xcodebuild build \ + -project OMG.xcodeproj \ + -scheme OMG \ + -configuration Debug \ + -destination 'platform=macOS' \ + | xcpretty || exit 1 + continue-on-error: false diff --git a/.github/workflows/swiftformat.yml b/.github/workflows/swiftformat.yml new file mode 100644 index 0000000..1eba742 --- /dev/null +++ b/.github/workflows/swiftformat.yml @@ -0,0 +1,27 @@ +name: SwiftFormat Check + +on: + pull_request: + branches: + - main + - develop + +jobs: + swiftformat: + name: Code Formatting Check + runs-on: macos-26 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - 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 diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/unit-tests.yml similarity index 61% rename from .github/workflows/pr-checks.yml rename to .github/workflows/unit-tests.yml index bd0111a..437d9af 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/unit-tests.yml @@ -1,4 +1,4 @@ -name: Pull Request Checks +name: Unit Tests on: pull_request: @@ -7,8 +7,8 @@ on: - develop jobs: - build-and-format: - name: Build and Format Check + test: + name: Run Unit Tests runs-on: macos-26 steps: @@ -23,17 +23,6 @@ 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: @@ -47,16 +36,6 @@ jobs: - name: Resolve Swift Package dependencies run: xcodebuild -resolvePackageDependencies -project OMG.xcodeproj -scheme OMG - - name: Build OMG - run: | - xcodebuild build \ - -project OMG.xcodeproj \ - -scheme OMG \ - -configuration Debug \ - -destination 'platform=macOS' \ - | xcpretty || exit 1 - continue-on-error: false - - name: Run OMG Tests run: | xcodebuild test \