Skip to content

Commit 3fc3f7c

Browse files
authored
Fix ci (#1)
* add config * add config * fix * fix * fix * add codecov
1 parent f83d118 commit 3fc3f7c

File tree

15 files changed

+82
-140
lines changed

15 files changed

+82
-140
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,26 @@ jobs:
2929
- name: Run linting
3030
run: npm run lint
3131

32-
- name: Run tests
33-
run: npm test
32+
- name: Run tests with coverage
33+
run: npm run test:coverage
3434

3535
- name: Build
36-
run: npm run build
36+
run: npm run build
37+
38+
# Upload coverage report to Codecov
39+
- name: Upload coverage to Codecov
40+
uses: codecov/codecov-action@v5
41+
with:
42+
directory: ./coverage
43+
flags: frontend,typescript,react
44+
name: frontend-coverage
45+
fail_ci_if_error: true
46+
token: ${{ secrets.CODECOV_TOKEN }}
47+
verbose: true
48+
49+
# Upload coverage reports as artifacts
50+
- name: Upload coverage reports
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: frontend-coverage-report
54+
path: coverage

codecov.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: 80%
6+
threshold: 1%
7+
patch:
8+
default:
9+
target: 80%
10+
threshold: 1%
11+
12+
comment:
13+
layout: "reach, diff, flags, files"
14+
behavior: default
15+
require_changes: false
16+
17+
ignore:
18+
- "src/types/*.ts"
19+
- "src/scripts/*.ts"
20+
- "**/vite.config.ts"
21+
- "**/vitest.config.ts"
22+
- "**/*.test.ts"
23+
- "**/*.test.tsx"
24+
- "**/*.spec.ts"
25+
- "**/*.spec.tsx"

package-lock.json

Lines changed: 7 additions & 126 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@
2828
},
2929
"devDependencies": {
3030
"@eslint/js": "^9.22.0",
31-
"@testing-library/jest-dom": "^6.6.3",
31+
"@types/dagre": "^0.7.52",
3232
"@types/node": "^22.14.1",
3333
"@types/react": "^19.0.10",
3434
"@types/react-dom": "^19.0.4",
35-
"@types/testing-library__jest-dom": "^6.0.0",
3635
"@vitejs/plugin-react": "^4.3.4",
3736
"@vitest/coverage-istanbul": "^3.1.2",
3837
"eslint": "^9.25.1",

src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { CssBaseline, ThemeProvider, createTheme } from '@mui/material';
32
import FFmpegFlowEditor from './components/FFmpegFlowEditor';
43

src/components/FilterNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface ValidationError {
1111

1212
function FilterNode({ data, id }: NodeProps<NodeData>) {
1313
const theme = useTheme();
14-
const [parameters, setParameters] = useState<Record<string, string>>(data.parameters || {});
14+
const [parameters, setParameters] = useState<Record<string, string | number | boolean>>(data.parameters || {});
1515
const [errors, setErrors] = useState<ValidationError>({});
1616
const [expanded, setExpanded] = useState<boolean>(false);
1717
const updateNodeInternals = useUpdateNodeInternals();

src/components/GlobalNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const globalOptions = options.filter(
1919

2020
function GlobalNode({ data, id }: NodeProps<NodeData>) {
2121
const theme = useTheme();
22-
const [parameters, setParameters] = useState<Record<string, string>>(data.parameters || {});
22+
const [parameters, setParameters] = useState<Record<string, string | boolean | number>>(data.parameters || {});
2323
const [expanded, setExpanded] = useState<boolean>(false);
2424

2525
// Update local state when data changes

src/components/InputNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const inputOptions = options.filter(
1414
function InputNode({ data, id }: NodeProps<NodeData>) {
1515
const theme = useTheme();
1616
const [filename, setFilename] = useState<string>(data.filename || '');
17-
const [parameters, setParameters] = useState<Record<string, string>>(data.parameters || {});
17+
const [parameters, setParameters] = useState<Record<string, string | number | boolean>>(data.parameters || {});
1818
const [expanded, setExpanded] = useState<boolean>(false);
1919

2020
// Update local state when data changes

src/components/OutputNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const outputOptions = options.filter(
1414
function OutputNode({ data, id }: NodeProps<NodeData>) {
1515
const theme = useTheme();
1616
const [filename, setFilename] = useState<string>(data.filename || '');
17-
const [parameters, setParameters] = useState<Record<string, string>>(data.parameters || {});
17+
const [parameters, setParameters] = useState<Record<string, string | number | boolean>>(data.parameters || {});
1818
const [expanded, setExpanded] = useState<boolean>(false);
1919

2020
// Update local state when data changes

src/utils/__tests__/nodeMapping.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('Node Mapping', () => {
6464

6565
// Deserialize
6666
const deserialized = loads(jsonString);
67-
await nodeMappingManager._recursiveAddInternal(deserialized as Node | Stream);
67+
await nodeMappingManager.recursiveAdd(deserialized as Stream);
6868
// check node mapping's snapshot
6969
expect(deserialized).toMatchSnapshot();
7070
expect(loads(nodeMappingManager.toJson())).toMatchSnapshot();

0 commit comments

Comments
 (0)