diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..08c249d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +name: CI + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main, develop ] + +jobs: + test-lint-build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js LTS + uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Lint code + run: pnpm lint + + - name: Run tests + run: pnpm test + + - name: Build project + run: pnpm build + + - name: Check build artifacts + run: | + if [ -d "apps/dashboard/dist" ]; then + echo "✅ Build artifacts created successfully" + ls -la apps/dashboard/dist/ + else + echo "❌ Build artifacts not found" + exit 1 + fi \ No newline at end of file