From 53719b2dd0453f17f9b3c438b1b3dc46b0a579cf Mon Sep 17 00:00:00 2001 From: aitbc1 Date: Sat, 28 Mar 2026 08:34:16 +0100 Subject: [PATCH] feat: add JavaScript SDK testing workflow - Build TypeScript compilation - Run vitest tests - Lint with ESLint - Check formatting with Prettier - Upload test results as artifacts --- .gitea/workflows/js-sdk-tests.yml | 87 +++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .gitea/workflows/js-sdk-tests.yml diff --git a/.gitea/workflows/js-sdk-tests.yml b/.gitea/workflows/js-sdk-tests.yml new file mode 100644 index 00000000..794bdb63 --- /dev/null +++ b/.gitea/workflows/js-sdk-tests.yml @@ -0,0 +1,87 @@ +name: JavaScript SDK Tests + +on: + push: + branches: [ main, develop ] + paths: + - 'packages/js/**' + - '.gitea/workflows/js-sdk-tests.yml' + pull_request: + branches: [ main, develop ] + paths: + - 'packages/js/**' + - '.gitea/workflows/js-sdk-tests.yml' + workflow_dispatch: + +# Prevent parallel execution +concurrency: + group: js-sdk-tests-${{ github.ref }} + cancel-in-progress: true + +jobs: + test-js-sdk: + runs-on: debian + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: packages/js/aitbc-sdk/package-lock.json + + - name: Install dependencies + working-directory: packages/js/aitbc-sdk + run: | + echo "=== INSTALLING JS SDK DEPENDENCIES ===" + npm ci + echo "✅ Dependencies installed" + + - name: Build TypeScript + working-directory: packages/js/aitbc-sdk + run: | + echo "=== BUILDING TYPESCRIPT ===" + npm run build + echo "✅ TypeScript build completed" + + - name: Run ESLint + working-directory: packages/js/aitbc-sdk + run: | + echo "=== RUNNING ESLINT ===" + npm run lint + echo "✅ ESLint checks passed" + + - name: Check Prettier formatting + working-directory: packages/js/aitbc-sdk + run: | + echo "=== CHECKING PRETTIER FORMATTING ===" + npx prettier --check "src/**/*.ts" + echo "✅ Prettier formatting checks passed" + + - name: Run vitest tests + working-directory: packages/js/aitbc-sdk + run: | + echo "=== RUNNING VITEST ===" + npm run test + echo "✅ Vitest tests completed" + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: js-sdk-test-results + path: packages/js/aitbc-sdk/test-results/ + retention-days: 30 + + - name: Test Summary + if: always() + run: | + echo "=== JS SDK TEST SUMMARY ===" + echo "✅ TypeScript build: completed" + echo "✅ ESLint: passed" + echo "✅ Prettier: passed" + echo "✅ Vitest tests: completed" + echo "✅ JavaScript SDK tests finished successfully"