From c293a618999cfd355bc63c5fbe52f1824c8c3052 Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 28 Nov 2024 16:36:11 +0000 Subject: [PATCH] Add linting, type checking, and build verification to CI workflow --- .github/workflows/ci.yml | 22 ++++++++++++++++++++-- package.json | 7 +++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5f0af2..895b974 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: branches: [ main, openhands-workspace ] jobs: - test: + verify: runs-on: ubuntu-latest strategy: @@ -26,8 +26,26 @@ jobs: - name: Install dependencies run: npm ci + - name: Run linting + run: npm run lint + + - name: Run type checking + run: npm run typecheck + - name: Run tests run: npm test env: CI: true - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build verification + run: npm run build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: dist + path: dist/ + retention-days: 7 \ No newline at end of file diff --git a/package.json b/package.json index 1a839ce..a76c5b5 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,12 @@ "dev": "vite", "build": "tsc -b && vite build", "lint": "eslint .", + "lint:fix": "eslint . --fix", "preview": "vite preview", - "test": "vitest", - "test:coverage": "vitest run --coverage" + "test": "vitest run", + "test:watch": "vitest", + "test:coverage": "vitest run --coverage", + "typecheck": "tsc --noEmit" }, "dependencies": { "react": "^18.3.1",