Release v2.15.3 — revert CI dedup, restore strict tag validation #96
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| quality: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [20] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| # Install dependencies | |
| - name: Install frontend dependencies | |
| run: cd frontend && npm ci | |
| - name: Install backend dependencies | |
| run: cd backend && npm ci | |
| # Type checking | |
| - name: Typecheck frontend | |
| run: | | |
| cd frontend && npx tsc --noEmit 2>&1 || { | |
| echo "" | |
| echo "::error::Frontend type check failed. Fix the TypeScript errors above." | |
| exit 1 | |
| } | |
| - name: Typecheck backend | |
| run: | | |
| cd backend && npx tsc --noEmit 2>&1 || { | |
| echo "" | |
| echo "::error::Backend type check failed. Fix the TypeScript errors above." | |
| exit 1 | |
| } | |
| # Linting | |
| - name: Lint frontend | |
| run: | | |
| cd frontend | |
| OUTPUT=$(npx eslint . 2>&1) || { | |
| echo "$OUTPUT" | |
| echo "" | |
| echo "::error::Frontend lint failed. Run 'cd frontend && npx eslint . --fix' to auto-fix, then commit." | |
| exit 1 | |
| } | |
| echo "$OUTPUT" | |
| - name: Lint backend | |
| run: | | |
| cd backend | |
| OUTPUT=$(npx eslint . 2>&1) || { | |
| echo "$OUTPUT" | |
| echo "" | |
| echo "::error::Backend lint failed. Run 'cd backend && npx eslint . --fix' to auto-fix, then commit." | |
| exit 1 | |
| } | |
| echo "$OUTPUT" | |
| # Formatting | |
| - name: Format check | |
| run: | | |
| UNFORMATTED=$(npx -y prettier --list-different "frontend/**/*.{ts,tsx,js,jsx,json}" "backend/**/*.{ts,js,json}" "*.{json,md,yml,yaml}" 2>/dev/null || true) | |
| if [ -n "$UNFORMATTED" ]; then | |
| echo "Unformatted files:" | |
| echo "$UNFORMATTED" | |
| echo "" | |
| echo "::error::Files above are not formatted. Run 'npx prettier --write .' locally and commit." | |
| exit 1 | |
| fi | |
| echo "All files formatted correctly." | |
| # Tests | |
| - name: Test frontend | |
| run: | | |
| cd frontend && npm test 2>&1 || { | |
| echo "" | |
| echo "::error::Frontend tests failed. Run 'cd frontend && npm test' locally to debug." | |
| exit 1 | |
| } | |
| - name: Test backend | |
| run: | | |
| cd backend && npm test 2>&1 || { | |
| echo "" | |
| echo "::error::Backend tests failed. Run 'cd backend && npm test' locally to debug." | |
| exit 1 | |
| } | |
| # Build | |
| - name: Build frontend | |
| run: | | |
| cd frontend && npx vite build 2>&1 || { | |
| echo "" | |
| echo "::error::Frontend build failed. Run 'cd frontend && npx vite build' locally to debug." | |
| exit 1 | |
| } | |
| - name: Build backend | |
| run: | | |
| cd backend && npm run build 2>&1 || { | |
| echo "" | |
| echo "::error::Backend build failed. Run 'cd backend && npm run build' locally to debug." | |
| exit 1 | |
| } | |
| # Docker publish — only on version tags, after CI passes | |
| docker: | |
| needs: quality | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: idemerge/llm-api-bench | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern=v{{version}} | |
| type=raw,value=latest | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |