diff --git a/.github/workflows/ios-ci.yml b/.github/workflows/ios-ci.yml index c1ad6fc5b..14c102df2 100644 --- a/.github/workflows/ios-ci.yml +++ b/.github/workflows/ios-ci.yml @@ -25,14 +25,15 @@ jobs: uses: actions/checkout@v4 - name: Select Xcode - run: sudo xcode-select -s /Applications/Xcode_15.4.app + run: sudo xcode-select -s ${{ env.XCODE_APP_PATH || '/Applications/Xcode_15.4.app' }} + env: + XCODE_APP_PATH: ${{ vars.XCODE_APP_PATH || '/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 + swift-format lint --recursive Lendair/Models Lendair/Services Lendair/ViewModels Lendair/Views || { echo "::warning::Swift format issues detected (non-blocking)" - fi + } build: name: Build @@ -43,7 +44,9 @@ jobs: uses: actions/checkout@v4 - name: Select Xcode - run: sudo xcode-select -s /Applications/Xcode_15.4.app + run: sudo xcode-select -s ${{ env.XCODE_APP_PATH || '/Applications/Xcode_15.4.app' }} + env: + XCODE_APP_PATH: ${{ vars.XCODE_APP_PATH || '/Applications/Xcode_15.4.app' }} - name: Swift version run: swift --version @@ -53,7 +56,7 @@ jobs: working-directory: Lendair - name: Build - run: swift build -c release + run: swift build working-directory: Lendair test: @@ -65,8 +68,38 @@ jobs: uses: actions/checkout@v4 - name: Select Xcode - run: sudo xcode-select -s /Applications/Xcode_15.4.app + run: sudo xcode-select -s ${{ env.XCODE_APP_PATH || '/Applications/Xcode_15.4.app' }} + env: + XCODE_APP_PATH: ${{ vars.XCODE_APP_PATH || '/Applications/Xcode_15.4.app' }} - name: Run tests run: swift test working-directory: Lendair + + deploy-testflight: + name: Deploy to TestFlight + runs-on: macos-latest + needs: test + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Select Xcode + run: sudo xcode-select -s ${{ env.XCODE_APP_PATH || '/Applications/Xcode_15.4.app' }} + env: + XCODE_APP_PATH: ${{ vars.XCODE_APP_PATH || '/Applications/Xcode_15.4.app' }} + + - name: Build for TestFlight + run: swift build -c release + working-directory: Lendair + + - name: Upload to TestFlight + uses: apple-actions/upload-testflight-binary@v1 + with: + app-path: Lendair/.build/release/Lendair + github-token: ${{ secrets.GITHUB_TOKEN }} + env: + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} diff --git a/.github/workflows/web-ci.yml b/.github/workflows/web-ci.yml index 6b83bb976..e46fac893 100644 --- a/.github/workflows/web-ci.yml +++ b/.github/workflows/web-ci.yml @@ -4,22 +4,28 @@ on: push: branches: [main] paths: - - "web/**" + - "*.json" + - "*.ts" + - "*.tsx" + - "*.js" + - "*.jsx" + - "*.html" - ".github/workflows/web-ci.yml" pull_request: branches: [main] paths: - - "web/**" + - "*.json" + - "*.ts" + - "*.tsx" + - "*.js" + - "*.jsx" + - "*.html" - ".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 @@ -33,7 +39,7 @@ jobs: with: node-version: 20 cache: npm - cache-dependency-path: web/package-lock.json + cache-dependency-path: package-lock.json - name: Install dependencies run: npm ci @@ -54,7 +60,7 @@ jobs: with: node-version: 20 cache: npm - cache-dependency-path: web/package-lock.json + cache-dependency-path: package-lock.json - name: Install dependencies run: npm ci @@ -75,7 +81,7 @@ jobs: with: node-version: 20 cache: npm - cache-dependency-path: web/package-lock.json + cache-dependency-path: package-lock.json - name: Install dependencies run: npm ci @@ -93,10 +99,9 @@ jobs: uses: actions/checkout@v4 - name: Deploy to Vercel - uses: amondnet/vercel-action@v25 + uses: amondnet/vercel-action@v30 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/package.json b/package.json new file mode 100644 index 000000000..22cd21fee --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "lendair-web", + "version": "0.1.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview", + "test": "vitest run", + "test:watch": "vitest", + "typecheck": "tsc --noEmit" + }, + "devDependencies": { + "typescript": "^5.4.0", + "vite": "^5.2.0", + "vitest": "^1.4.0" + } +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 000000000..0a650a50b --- /dev/null +++ b/src/index.ts @@ -0,0 +1 @@ +export const APP_NAME = 'Lendair'; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..e61ad46a7 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "isolatedModules": true, + "moduleDetection": "force", + "noEmit": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx"] +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 000000000..78e7e46e7 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite'; + +export default defineConfig({ + build: { + outDir: 'dist', + }, +});