ci: align workflows with current monorepo structure
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
This commit is contained in:
75
.github/workflows/ci-iam-service.yml
vendored
75
.github/workflows/ci-iam-service.yml
vendored
@@ -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
|
||||
|
||||
95
.github/workflows/ci-mobile.yml
vendored
95
.github/workflows/ci-mobile.yml
vendored
@@ -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
|
||||
|
||||
33
.github/workflows/ci-web.yml
vendored
33
.github/workflows/ci-web.yml
vendored
@@ -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
|
||||
|
||||
28
.github/workflows/deploy-production.yml
vendored
28
.github/workflows/deploy-production.yml
vendored
@@ -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
|
||||
|
||||
28
.github/workflows/deploy-staging.yml
vendored
28
.github/workflows/deploy-staging.yml
vendored
@@ -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
|
||||
|
||||
39
.github/workflows/docker-build.yml
vendored
39
.github/workflows/docker-build.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user