diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 05a07e19..fdaa3408 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -3,9 +3,17 @@ name: CI — Common Platform on: push: branches: [main] + paths: + - 'packages/**' + - 'services/**' + - 'dashboards/**' + - 'pnpm-lock.yaml' + - 'pnpm-workspace.yaml' + - 'package.json' + - 'tsconfig.base.json' concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ci-common-plat-${{ github.ref }} cancel-in-progress: true jobs: @@ -13,63 +21,63 @@ jobs: name: Build, Test & Typecheck runs-on: ubuntu-latest timeout-minutes: 15 - defaults: - run: - working-directory: /Users/sd9235/code/mygh/learning_ai_common_plat steps: - - name: Reset and pull latest - run: git reset --hard HEAD && git clean -fd && git pull --ff-only origin main || true + - name: Pull latest + run: | + cd /opt/bytelyst/learning_ai_common_plat + git fetch origin main + git checkout main + git reset --hard origin/main + + - name: Install dependencies + run: | + cd /opt/bytelyst/learning_ai_common_plat + pnpm install --frozen-lockfile - name: Build all packages - run: pnpm -r --filter './packages/**' build + run: | + cd /opt/bytelyst/learning_ai_common_plat + pnpm build - name: Lint - run: pnpm lint + run: | + cd /opt/bytelyst/learning_ai_common_plat + pnpm lint - name: Typecheck - run: pnpm typecheck + run: | + cd /opt/bytelyst/learning_ai_common_plat + pnpm typecheck - name: Test - run: pnpm test - - token-drift: - name: Check design token drift - runs-on: ubuntu-latest - timeout-minutes: 5 - defaults: - run: - working-directory: /Users/sd9235/code/mygh/learning_ai_common_plat - steps: - - name: Reset and pull latest - run: git reset --hard HEAD && git clean -fd && git pull --ff-only origin main || true - - - name: Regenerate tokens - run: npx tsx packages/design-tokens/scripts/generate.ts - - - name: Check for drift run: | - if git diff --exit-code packages/design-tokens/generated/; then - echo "✅ No token drift detected" - else - echo "❌ Token drift detected — run 'npx tsx packages/design-tokens/scripts/generate.ts' and commit" - git diff packages/design-tokens/generated/ - exit 1 - fi + cd /opt/bytelyst/learning_ai_common_plat + pnpm test publish-packages: name: Publish @bytelyst/* to Gitea npm registry runs-on: ubuntu-latest needs: [build-and-test] - timeout-minutes: 10 - defaults: - run: - working-directory: /Users/sd9235/code/mygh/learning_ai_common_plat + timeout-minutes: 15 steps: - - name: Reset and pull latest - run: git reset --hard HEAD && git clean -fd && git pull --ff-only origin main || true + - name: Pull latest + run: | + cd /opt/bytelyst/learning_ai_common_plat + git fetch origin main + git checkout main + git reset --hard origin/main + + - name: Install dependencies + run: | + cd /opt/bytelyst/learning_ai_common_plat + pnpm install --frozen-lockfile - name: Build all packages - run: pnpm -r --filter './packages/**' build + run: | + cd /opt/bytelyst/learning_ai_common_plat + pnpm build - name: Publish outdated packages to Gitea registry - run: bash ./scripts/gitea/publish-outdated-packages.sh --skip-build + run: | + cd /opt/bytelyst/learning_ai_common_plat + bash ./scripts/gitea/publish-outdated-packages.sh --skip-build