Skip to content

Commit 2acfc7a

Browse files
syamsasi99claude
andcommitted
Add CI workflow with linting and coverage reporting
- Add ESLint configuration with TypeScript and React support - Add npm scripts for linting (lint, lint:fix) and type-checking - Create CI workflow with three jobs: - Lint: ESLint and TypeScript type checking - Test: Unit tests with coverage reporting to Codecov - Build: Verify application builds successfully - Add CI, Release, and Codecov badges to README - Update GitHub URLs to syamsasi99 - Update version badge to 0.0.1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 23d9ba2 commit 2acfc7a

5 files changed

Lines changed: 3161 additions & 195 deletions

File tree

.github/workflows/ci.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master, main, develop]
6+
pull_request:
7+
branches: [master, main, develop]
8+
9+
jobs:
10+
lint:
11+
name: Lint Code
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '18'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run ESLint
27+
run: npm run lint
28+
29+
- name: Run TypeScript type check
30+
run: npm run type-check
31+
32+
test:
33+
name: Run Tests with Coverage
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v4
38+
39+
- name: Setup Node.js
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: '18'
43+
cache: 'npm'
44+
45+
- name: Install dependencies
46+
run: npm ci
47+
48+
- name: Run unit tests with coverage
49+
run: npm run test:coverage
50+
51+
- name: Upload coverage reports to Codecov
52+
uses: codecov/codecov-action@v4
53+
with:
54+
token: ${{ secrets.CODECOV_TOKEN }}
55+
files: ./coverage/coverage-final.json
56+
flags: unittests
57+
name: codecov-umbrella
58+
fail_ci_if_error: false
59+
60+
- name: Upload coverage to artifacts
61+
if: always()
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: coverage-report
65+
path: coverage/
66+
retention-days: 30
67+
68+
build:
69+
name: Build Application
70+
runs-on: ubuntu-latest
71+
needs: [lint, test]
72+
steps:
73+
- name: Checkout code
74+
uses: actions/checkout@v4
75+
76+
- name: Setup Node.js
77+
uses: actions/setup-node@v4
78+
with:
79+
node-version: '18'
80+
cache: 'npm'
81+
82+
- name: Install dependencies
83+
run: npm ci
84+
85+
- name: Build renderer
86+
run: npm run build:renderer
87+
88+
- name: Build electron
89+
run: npm run build:electron
90+
91+
- name: Check build outputs
92+
run: |
93+
test -d dist || (echo "dist directory not found" && exit 1)
94+
test -d dist-electron || (echo "dist-electron directory not found" && exit 1)
95+
echo "Build successful!"

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
A powerful desktop GUI application for building, running, and analyzing [Promptfoo](https://promptfoo.dev) LLM evaluations. Built with Electron, React, and TypeScript.
44

55
![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)
6-
![Version](https://img.shields.io/badge/version-1.0.0-green.svg)
6+
![Version](https://img.shields.io/badge/version-0.0.1-green.svg)
7+
![CI](https://github.com/syamsasi99/prompt-evaluator/workflows/CI/badge.svg)
8+
![Release](https://github.com/syamsasi99/prompt-evaluator/workflows/Build%20and%20Release/badge.svg)
9+
[![codecov](https://codecov.io/gh/syamsasi99/prompt-evaluator/branch/master/graph/badge.svg)](https://codecov.io/gh/syamsasi99/prompt-evaluator)
710

811
## Overview
912

@@ -136,7 +139,7 @@ Prompt Evaluator follows a modern desktop application architecture with clear se
136139

137140
### Download Pre-built Installers (Recommended)
138141

139-
The easiest way to get started is to download a pre-built installer from the [GitHub Releases](https://github.com/syamsasi/prompt-evaluator/releases) page.
142+
The easiest way to get started is to download a pre-built installer from the [GitHub Releases](https://github.com/syamsasi99/prompt-evaluator/releases) page.
140143

141144
**Available Downloads:**
142145
- **macOS**: `.dmg` installer or `.zip` archive
@@ -173,7 +176,7 @@ If you want to build and install the application from source code:
173176

174177
1. **Clone the repository**
175178
```bash
176-
git clone https://github.com/syamsasi/prompt-evaluator.git
179+
git clone https://github.com/syamsasi99/prompt-evaluator.git
177180
cd prompt-evaluator
178181
```
179182

eslint.config.mjs

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import js from '@eslint/js';
2+
import typescript from '@typescript-eslint/eslint-plugin';
3+
import typescriptParser from '@typescript-eslint/parser';
4+
import react from 'eslint-plugin-react';
5+
import reactHooks from 'eslint-plugin-react-hooks';
6+
import globals from 'globals';
7+
8+
export default [
9+
{
10+
ignores: [
11+
'node_modules/**',
12+
'dist/**',
13+
'dist-electron/**',
14+
'release/**',
15+
'coverage/**',
16+
'test-results/**',
17+
'playwright-report/**',
18+
'*.config.js',
19+
'*.config.ts',
20+
'*.config.mjs',
21+
'build/**',
22+
],
23+
},
24+
{
25+
files: ['**/*.{js,mjs,cjs,jsx,ts,tsx}'],
26+
languageOptions: {
27+
parser: typescriptParser,
28+
parserOptions: {
29+
ecmaVersion: 'latest',
30+
sourceType: 'module',
31+
ecmaFeatures: {
32+
jsx: true,
33+
},
34+
},
35+
globals: {
36+
...globals.browser,
37+
...globals.node,
38+
...globals.es2021,
39+
},
40+
},
41+
plugins: {
42+
'@typescript-eslint': typescript,
43+
react,
44+
'react-hooks': reactHooks,
45+
},
46+
settings: {
47+
react: {
48+
version: 'detect',
49+
},
50+
},
51+
rules: {
52+
...js.configs.recommended.rules,
53+
...typescript.configs.recommended.rules,
54+
...react.configs.recommended.rules,
55+
...reactHooks.configs.recommended.rules,
56+
// Disable prop-types as we use TypeScript
57+
'react/prop-types': 'off',
58+
// Allow unused vars that start with underscore
59+
'@typescript-eslint/no-unused-vars': [
60+
'warn',
61+
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
62+
],
63+
// Allow explicit any types (warn instead of error)
64+
'@typescript-eslint/no-explicit-any': 'warn',
65+
// Allow require() in electron main process
66+
'@typescript-eslint/no-require-imports': 'off',
67+
// Allow console logs (can be removed in production build)
68+
'no-console': 'off',
69+
},
70+
},
71+
];

0 commit comments

Comments
 (0)