From 68627dc011a9e7ad38f75604b5d9fc3ff073a07f Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 23 Feb 2026 12:20:33 +0000 Subject: [PATCH] ci: align workflows with current monorepo structure Co-authored-by: Velik --- .github/workflows/ci-iam-service.yml | 75 ++++++++----------- .github/workflows/ci-mobile.yml | 95 +++++++++++++------------ .github/workflows/ci-web.yml | 33 +++++---- .github/workflows/deploy-production.yml | 28 ++++---- .github/workflows/deploy-staging.yml | 28 ++++---- .github/workflows/docker-build.yml | 39 ++-------- 6 files changed, 127 insertions(+), 171 deletions(-) diff --git a/.github/workflows/ci-iam-service.yml b/.github/workflows/ci-iam-service.yml index 44b192c8..36fe4ae7 100644 --- a/.github/workflows/ci-iam-service.yml +++ b/.github/workflows/ci-iam-service.yml @@ -3,18 +3,18 @@ name: IAM Service CI on: push: paths: - - 'services/iam-service/**' - - 'packages/**' + - 'services/iam-service-net/**' pull_request: paths: - - 'services/iam-service/**' - - 'packages/**' + - 'services/iam-service-net/**' + +permissions: + contents: read jobs: - lint-and-test: + build-and-test: runs-on: ubuntu-latest - - # Use Neon test database if available, otherwise use PostgreSQL service + services: postgres: image: postgres:16-alpine @@ -32,45 +32,26 @@ jobs: steps: - uses: actions/checkout@v4 - - - name: Setup PNPM - uses: pnpm/action-setup@v2 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 with: - version: 8 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '25' - cache: 'pnpm' - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build shared packages - run: pnpm --filter './packages/*' build - - - name: Generate Prisma Client - run: pnpm --filter @goodgo/iam-service prisma:generate + dotnet-version: '10.0.x' + + - name: Restore API project + run: dotnet restore services/iam-service-net/src/IamService.API/IamService.API.csproj + + - name: Build API project + run: dotnet build services/iam-service-net/src/IamService.API/IamService.API.csproj --configuration Release --no-restore + + - name: Restore test projects + run: dotnet restore services/iam-service-net/tests/IamService.UnitTests/IamService.UnitTests.csproj && dotnet restore services/iam-service-net/tests/IamService.FunctionalTests/IamService.FunctionalTests.csproj + + - name: Run unit tests + run: dotnet test services/iam-service-net/tests/IamService.UnitTests/IamService.UnitTests.csproj --configuration Release --no-restore --verbosity normal + + - name: Run functional tests + run: dotnet test services/iam-service-net/tests/IamService.FunctionalTests/IamService.FunctionalTests.csproj --configuration Release --no-restore --verbosity normal env: - # Use Neon test DB if available, otherwise fallback to local PostgreSQL - DATABASE_URL: ${{ secrets.NEON_DATABASE_URL_TEST != '' && secrets.NEON_DATABASE_URL_TEST || 'postgresql://testuser:testpass@localhost:5432/test_db' }} - - - name: Run migrations - run: pnpm --filter @goodgo/iam-service prisma migrate deploy - env: - DATABASE_URL: ${{ secrets.NEON_DATABASE_URL_TEST != '' && secrets.NEON_DATABASE_URL_TEST || 'postgresql://testuser:testpass@localhost:5432/test_db' }} - - - name: Lint - run: pnpm --filter @goodgo/iam-service lint - - - name: Type check - run: pnpm --filter @goodgo/iam-service typecheck - - - name: Build - run: pnpm --filter @goodgo/iam-service build - - - name: Test - run: pnpm --filter @goodgo/iam-service test - env: - DATABASE_URL: ${{ secrets.NEON_DATABASE_URL_TEST != '' && secrets.NEON_DATABASE_URL_TEST || 'postgresql://testuser:testpass@localhost:5432/test_db' }} + ConnectionStrings__DefaultConnection: Host=localhost;Port=5432;Database=test_db;Username=testuser;Password=testpass + ASPNETCORE_ENVIRONMENT: Testing diff --git a/.github/workflows/ci-mobile.yml b/.github/workflows/ci-mobile.yml index bc990449..c3ded279 100644 --- a/.github/workflows/ci-mobile.yml +++ b/.github/workflows/ci-mobile.yml @@ -3,55 +3,60 @@ name: Mobile Apps CI on: push: paths: - - 'apps/app-*/**' - - 'packages/**' + - 'apps/app-client-base-net/**' + - 'apps/app-client-base-swift/**' + - 'apps/web-client-base-net/**' + - 'apps/web-client-tpos-net/**' + - 'apps/web-client-eggymon-landipage-net/**' pull_request: paths: - - 'apps/app-*/**' - - 'packages/**' + - 'apps/app-client-base-net/**' + - 'apps/app-client-base-swift/**' + - 'apps/web-client-base-net/**' + - 'apps/web-client-tpos-net/**' + - 'apps/web-client-eggymon-landipage-net/**' jobs: - lint-and-test: + dotnet-client-apps: + runs-on: ubuntu-latest + strategy: + matrix: + project: + - apps/web-client-base-net/src/WebClientBase.Server/WebClientBase.Server.csproj + - apps/web-client-tpos-net/src/WebClientTpos.Server/WebClientTpos.Server.csproj + - apps/web-client-eggymon-landipage-net/src/EggymonLandingPage.Server/EggymonLandingPage.Server.csproj + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + + - name: Restore + run: dotnet restore ${{ matrix.project }} + + - name: Build + run: dotnet build ${{ matrix.project }} --configuration Release --no-restore + + swift-client-app: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - name: Build Swift iOS app + run: | + xcodebuild \ + -project apps/app-client-base-swift/AppClientBaseSwift/AppClientBaseSwift.xcodeproj \ + -scheme AppClientBaseSwift \ + -sdk iphonesimulator \ + -destination 'platform=iOS Simulator,name=iPhone 16' \ + build + + maui-project-validation: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - - name: Setup PNPM - uses: pnpm/action-setup@v2 - with: - version: 8 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '25' - cache: 'pnpm' - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Setup Flutter - uses: subosito/flutter-action@v2 - with: - flutter-version: '3.16.0' - channel: 'stable' - - - name: Install Flutter dependencies (Admin) - run: | - cd apps/app-admin - flutter pub get - - - name: Install Flutter dependencies (Client) - run: | - cd apps/app-client - flutter pub get - - - name: Analyze Flutter code (Admin) - run: | - cd apps/app-admin - flutter analyze - - - name: Analyze Flutter code (Client) - run: | - cd apps/app-client - flutter analyze + + - name: Validate MAUI project file exists + run: test -f apps/app-client-base-net/AppClientBase.csproj diff --git a/.github/workflows/ci-web.yml b/.github/workflows/ci-web.yml index 14a6923a..cfc6365d 100644 --- a/.github/workflows/ci-web.yml +++ b/.github/workflows/ci-web.yml @@ -3,15 +3,21 @@ name: Web Apps CI on: push: paths: - - 'apps/web-*/**' + - 'apps/web-client/**' + - 'apps/web-docs/**' - 'packages/**' + - 'pnpm-lock.yaml' + - 'package.json' pull_request: paths: - - 'apps/web-*/**' + - 'apps/web-client/**' + - 'apps/web-docs/**' - 'packages/**' + - 'pnpm-lock.yaml' + - 'package.json' jobs: - lint-and-test: + web-quality-gates: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -33,20 +39,17 @@ jobs: - name: Build shared packages run: pnpm --filter './packages/*' build - - name: Lint Web Admin - run: pnpm --filter @goodgo/web-admin lint || echo "Skipped" - - name: Lint Web Client - run: pnpm --filter @goodgo/web-client lint || echo "Skipped" - - - name: Type check Web Admin - run: pnpm --filter @goodgo/web-admin typecheck || echo "Skipped" + run: pnpm --filter @goodgo/web-client lint - name: Type check Web Client - run: pnpm --filter @goodgo/web-client typecheck || echo "Skipped" - - - name: Build Web Admin - run: pnpm --filter @goodgo/web-admin build || echo "Skipped" + run: pnpm --filter @goodgo/web-client typecheck + + - name: Test Web Client + run: pnpm --filter @goodgo/web-client test - name: Build Web Client - run: pnpm --filter @goodgo/web-client build || echo "Skipped" + run: pnpm --filter @goodgo/web-client build + + - name: Build Web Docs + run: pnpm --filter @goodgo/vitepress-docs build diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 851576e4..278fa9f8 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -4,6 +4,10 @@ on: push: branches: - main + paths: + - 'services/iam-service-net/**' + - 'apps/web-client/**' + - 'deployments/production/**' workflow_dispatch: jobs: @@ -13,27 +17,19 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup PNPM - uses: pnpm/action-setup@v2 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 with: - version: 8 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '25' - cache: 'pnpm' - - - name: Install dependencies - run: pnpm install --frozen-lockfile + dotnet-version: '10.0.x' - name: Run database migrations run: | - cd services/iam-service - pnpm prisma generate - pnpm prisma migrate deploy + dotnet tool install --global dotnet-ef || true + dotnet ef database update \ + --project services/iam-service-net/src/IamService.Infrastructure/IamService.Infrastructure.csproj \ + --startup-project services/iam-service-net/src/IamService.API/IamService.API.csproj env: - DATABASE_URL: ${{ secrets.NEON_DATABASE_URL_PRODUCTION }} + ConnectionStrings__DefaultConnection: ${{ secrets.NEON_DATABASE_URL_PRODUCTION }} - name: Setup kubectl uses: azure/setup-kubectl@v3 diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index d1c1dad5..0c69e0c6 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -4,6 +4,10 @@ on: push: branches: - develop + paths: + - 'services/iam-service-net/**' + - 'apps/web-client/**' + - 'deployments/staging/**' workflow_dispatch: jobs: @@ -12,27 +16,19 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup PNPM - uses: pnpm/action-setup@v2 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 with: - version: 8 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '25' - cache: 'pnpm' - - - name: Install dependencies - run: pnpm install --frozen-lockfile + dotnet-version: '10.0.x' - name: Run database migrations run: | - cd services/iam-service - pnpm prisma generate - pnpm prisma migrate deploy + dotnet tool install --global dotnet-ef || true + dotnet ef database update \ + --project services/iam-service-net/src/IamService.Infrastructure/IamService.Infrastructure.csproj \ + --startup-project services/iam-service-net/src/IamService.API/IamService.API.csproj env: - DATABASE_URL: ${{ secrets.NEON_DATABASE_URL_STAGING }} + ConnectionStrings__DefaultConnection: ${{ secrets.NEON_DATABASE_URL_STAGING }} - name: Setup kubectl uses: azure/setup-kubectl@v3 diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 630c1aac..a55737b1 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -6,8 +6,8 @@ on: - main - develop paths: - - 'services/iam-service/**' - - 'apps/web-*/**' + - 'services/iam-service-net/**' + - 'apps/web-client/**' workflow_dispatch: jobs: @@ -28,38 +28,13 @@ jobs: - name: Build and push IAM Service uses: docker/build-push-action@v5 with: - context: ./services/iam-service + context: ./services/iam-service-net push: true tags: | - goodgo/iam-service:latest - goodgo/iam-service:${{ github.sha }} - cache-from: type=registry,ref=goodgo/iam-service:buildcache - cache-to: type=registry,ref=goodgo/iam-service:buildcache,mode=max - - build-web-admin: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push Web Admin - uses: docker/build-push-action@v5 - with: - context: ./apps/web-admin - push: true - tags: | - goodgo/web-admin:latest - goodgo/web-admin:${{ github.sha }} - cache-from: type=registry,ref=goodgo/web-admin:buildcache - cache-to: type=registry,ref=goodgo/web-admin:buildcache,mode=max + goodgo/iam-service-net:latest + goodgo/iam-service-net:${{ github.sha }} + cache-from: type=registry,ref=goodgo/iam-service-net:buildcache + cache-to: type=registry,ref=goodgo/iam-service-net:buildcache,mode=max build-web-client: runs-on: ubuntu-latest