From 3bf7235461a9ea5f1ce8660eef24b7b7b5301174 Mon Sep 17 00:00:00 2001 From: Michael Freno Date: Thu, 7 May 2026 22:54:21 -0400 Subject: [PATCH] Add CI/CD pipelines for Lendair (iOS + web) [FRE-4690] - iOS: swift lint, build verification, and test on PR - Web: typecheck, vitest tests, build, and Vercel deployment (ready for web project) - Package.swift: defines Lendair as buildable Swift package - Test target: LendairTests with XCTest boilerplate Co-Authored-By: Paperclip --- .github/workflows/ios-ci.yml | 72 +++++++++++++++++ .github/workflows/web-ci.yml | 102 ++++++++++++++++++++++++ Lendair/LendairTests/LendairTests.swift | 7 ++ Lendair/Package.swift | 33 ++++++++ 4 files changed, 214 insertions(+) create mode 100644 .github/workflows/ios-ci.yml create mode 100644 .github/workflows/web-ci.yml create mode 100644 Lendair/LendairTests/LendairTests.swift create mode 100644 Lendair/Package.swift diff --git a/.github/workflows/ios-ci.yml b/.github/workflows/ios-ci.yml new file mode 100644 index 000000000..c1ad6fc5b --- /dev/null +++ b/.github/workflows/ios-ci.yml @@ -0,0 +1,72 @@ +name: iOS CI + +on: + push: + branches: [main] + paths: + - "Lendair/**" + - ".github/workflows/ios-ci.yml" + pull_request: + branches: [main] + paths: + - "Lendair/**" + - ".github/workflows/ios-ci.yml" + +concurrency: + group: ios-ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + name: Swift Lint + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Select Xcode + run: sudo xcode-select -s /Applications/Xcode_15.4.app + + - name: Swift Format Check + run: | + swift format --format --recursive Lendair/Models Lendair/Services Lendair/ViewModels Lendair/Views 2>/dev/null || true + if ! swift format --lint --recursive Lendair/Models Lendair/Services Lendair/ViewModels Lendair/Views 2>/dev/null; then + echo "::warning::Swift format issues detected (non-blocking)" + fi + + build: + name: Build + runs-on: macos-latest + needs: lint + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Select Xcode + run: sudo xcode-select -s /Applications/Xcode_15.4.app + + - name: Swift version + run: swift --version + + - name: Resolve dependencies + run: swift package resolve + working-directory: Lendair + + - name: Build + run: swift build -c release + working-directory: Lendair + + test: + name: Test + runs-on: macos-latest + needs: build + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Select Xcode + run: sudo xcode-select -s /Applications/Xcode_15.4.app + + - name: Run tests + run: swift test + working-directory: Lendair diff --git a/.github/workflows/web-ci.yml b/.github/workflows/web-ci.yml new file mode 100644 index 000000000..6b83bb976 --- /dev/null +++ b/.github/workflows/web-ci.yml @@ -0,0 +1,102 @@ +name: Web CI + +on: + push: + branches: [main] + paths: + - "web/**" + - ".github/workflows/web-ci.yml" + pull_request: + branches: [main] + paths: + - "web/**" + - ".github/workflows/web-ci.yml" + +concurrency: + group: web-ci-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + working-directory: web + +jobs: + check: + name: Type Check + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: web/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Type check + run: npx tsc --noEmit + + test: + name: Tests + runs-on: ubuntu-latest + needs: check + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: web/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npx vitest run --reporter=verbose + + build: + name: Build + runs-on: ubuntu-latest + needs: test + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: web/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + deploy: + name: Deploy to Vercel + runs-on: ubuntu-latest + needs: build + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Deploy to Vercel + uses: amondnet/vercel-action@v25 + with: + vercel-token: ${{ secrets.VERCEL_TOKEN }} + vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} + vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} + vercel-args: --prod + working-directory: web diff --git a/Lendair/LendairTests/LendairTests.swift b/Lendair/LendairTests/LendairTests.swift new file mode 100644 index 000000000..a3c67e7bf --- /dev/null +++ b/Lendair/LendairTests/LendairTests.swift @@ -0,0 +1,7 @@ +import XCTest + +class LendairTests: XCTestCase { + func testPackageLoads() throws { + XCTAssertTrue(true) + } +} diff --git a/Lendair/Package.swift b/Lendair/Package.swift new file mode 100644 index 000000000..ccda6e18f --- /dev/null +++ b/Lendair/Package.swift @@ -0,0 +1,33 @@ +// swift-tools-version: 5.9 +import PackageDescription + +let package = Package( + name: "Lendair", + platforms: [ + .iOS(.v16), + .macOS(.v13) + ], + products: [ + .library( + name: "Lendair", + targets: ["Lendair"] + ) + ], + targets: [ + .target( + name: "Lendair", + path: ".", + sources: [ + "Models", + "Services", + "ViewModels", + "Views" + ] + ), + .testTarget( + name: "LendairTests", + dependencies: ["Lendair"], + path: "LendairTests" + ) + ] +)