Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
06ae811
fix char in column
Maxime-Cllt Jun 24, 2025
912fa64
add lib.rs and app bench
Maxime-Cllt Jun 24, 2025
daa94df
fix
Maxime-Cllt Jun 24, 2025
1c50505
app version in About
Maxime-Cllt Jun 24, 2025
af49bcd
Fix style
Maxime-Cllt Jun 24, 2025
37f6939
update README.md
Maxime-Cllt Jun 24, 2025
845ce1e
add Unit test
Maxime-Cllt Aug 1, 2025
db070f5
add Unit Unit and better typing
Maxime-Cllt Aug 1, 2025
37da3af
upgrade CI GHA
Maxime-Cllt Aug 1, 2025
cbbde10
upgrade CI GHA
Maxime-Cllt Aug 1, 2025
3175f62
remove Security check in GHA ci.yml
Maxime-Cllt Aug 1, 2025
46fc17c
remove Security check in GHA ci.yml
Maxime-Cllt Aug 1, 2025
89f1ede
fix bench error leading to build crash
Maxime-Cllt Aug 1, 2025
bfeb53e
refactor: update database driver type and improve connection validation
Maxime-Cllt Sep 23, 2025
66517ae
refactor: standardize database configuration property names to use sn…
Maxime-Cllt Sep 23, 2025
8b365ea
refactor: rename DbConfig to DatabaseConfig and update usage across t…
Maxime-Cllt Sep 23, 2025
7521923
refactor: replace Connection with DatabaseConnection and update relat…
Maxime-Cllt Sep 23, 2025
82a854d
refactor: replace SQL builder functions with methods from SqlBuilder …
Maxime-Cllt Sep 23, 2025
c0248b9
refactor: add ComboItem struct with serialization and cloning tests
Maxime-Cllt Sep 23, 2025
358ae1f
refactor: implement DatabaseAction struct for database operations and…
Maxime-Cllt Sep 23, 2025
b734eb1
refactor: introduce BatchProcessor and TableExporter for paginated da…
Maxime-Cllt Sep 23, 2025
7ea1218
refactor: reorganize module structure and update imports for consistency
Maxime-Cllt Sep 23, 2025
0bc294c
refactor: update SaveConfig methods for improved file handling and se…
Maxime-Cllt Sep 23, 2025
ccf1baa
refactor: enhance CI/CD workflow with improved change detection and s…
Maxime-Cllt Sep 23, 2025
d0133c5
refactor: enhance CI/CD pipeline with improved change detection, cach…
Maxime-Cllt Sep 23, 2025
c27a8fd
refactor: reduce retention days for build artifacts and remove securi…
Maxime-Cllt Sep 23, 2025
d8d2c05
refactor: reduce retention days for build artifacts and remove securi…
Maxime-Cllt Sep 23, 2025
dedd4a2
refactor: reduce retention days for build artifacts and remove securi…
Maxime-Cllt Sep 23, 2025
0c9ea18
refactor: reduce retention days for build artifacts and remove securi…
Maxime-Cllt Sep 23, 2025
1e27f19
refactor: reduce retention days for build artifacts and remove securi…
Maxime-Cllt Sep 23, 2025
dbabc83
refactor: reduce retention days for build artifacts and remove securi…
Maxime-Cllt Sep 23, 2025
23c5a76
refactor: update Tauri integration tests and change database driver t…
Maxime-Cllt Sep 23, 2025
06c8765
refactor: remove unused test configuration functions and add dead cod…
Maxime-Cllt Sep 23, 2025
9aa093c
refactor: clean up imports and formatting across multiple files
Maxime-Cllt Sep 23, 2025
4b7a8f5
Merge branch 'main' into 1.0.4
Maxime-Cllt Sep 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 141 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,163 @@
name: Rust CI
name: Full Stack CI

on:
push:
branches: [ "main" ]
paths-ignore:
- '**.md'
- '.gitignore'
- 'LICENSE'
pull_request:
branches: [ "main" ]
paths-ignore:
- '**.md'
- '.gitignore'
- 'LICENSE'
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
build:
runs-on: macos-latest
# Check if we should skip CI
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
backend: ${{ steps.changes.outputs.backend }}
frontend: ${{ steps.changes.outputs.frontend }}
general: ${{ steps.changes.outputs.general }}
gha: ${{ steps.changes.outputs.gha }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Check for changes
uses: dorny/paths-filter@v3
id: changes
with:
# Define filters for different parts of the project to conditionally run jobs
filters: |
backend:
- 'src-tauri/**'
frontend:
- 'src/**'
- 'public/**'
- 'package.json'
- 'pnpm-lock.yaml'
- 'index.html'
- 'vite.config.*'
- 'tsconfig.json'
- 'tsconfig.node.json'
- 'postcss.config.js'
- 'tailwind.config.*'
- 'components.json'
- 'app-icon.png'
- 'pnpm-lock.yaml'
general:
- '**.md'
- '.gitignore'
- 'LICENSE'
- 'docs/**'
gha:
- '.github/**'


# Combined Full Stack Test and Build
full-stack-test-build:
name: Full Stack Test & Build
runs-on: ${{ matrix.os }}
needs: changes
if: needs.changes.outputs.general == 'false' || (needs.changes.outputs.backend == 'true' || needs.changes.outputs.frontend == 'true' || needs.changes.outputs.gha == 'true')

strategy:
fail-fast: false
matrix:
os: [ macos-latest ]

steps:
- name: Fetch Repository
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install stable Rust toolchain
# Setup all required tools
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: Install Rust Toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
cache: true

# Enhanced caching strategy
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Run tests
- name: Cache All Dependencies
uses: actions/cache@v4
with:
path: |
${{ env.STORE_PATH }}
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
src-tauri/target/
node_modules
dist/
key: ${{ runner.os }}-fullstack-${{ hashFiles('**/Cargo.lock', '**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-fullstack-
${{ runner.os }}-

# Install all dependencies
- name: Install Frontend Dependencies
run: pnpm install --frozen-lockfile

# Backend tests and checks (if backend changed)
- name: Run Rust Unit Tests
if: needs.changes.outputs.backend == 'true'
run: |
cd src-tauri
cargo test --verbose --all-features --lib

# Frontend tests and checks (if frontend changed)
- name: Run Frontend Unit Tests
if: needs.changes.outputs.frontend == 'true'
run: pnpm test
env:
NODE_ENV: test

# Build frontend first (required for Tauri)
- name: Build Frontend
run: pnpm run build

# Run Tauri integration tests
- name: Run Tauri Integration Tests
run: |
cd src-tauri
cargo test

# Start backend for integration tests (if needed)
- name: Start Backend for Integration Tests
if: needs.changes.outputs.frontend == 'true' && needs.changes.outputs.backend == 'true'
run: |
cd src-tauri
cargo test --verbose
cargo check --release

# Build Tauri application (includes both frontend and backend)
- name: Build Tauri Application
run: pnpm tauri build --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72 changes: 72 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Update Version Badge in Markdown Files

on:
push:
branches: [ "main", "master" ]
paths: [ 'src-tauri/Cargo.toml' ] # Trigger only when Cargo.toml changes
workflow_dispatch:

jobs:
update-badge:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Extract version from Cargo.toml
id: get_version
run: |
# Extract version using multiple methods for robustness
if command -v toml &> /dev/null; then
VERSION=$(toml get Cargo.toml package.version --raw 2>/dev/null)
fi

if [ -z "$VERSION" ]; then
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
fi

if [ -z "$VERSION" ]; then
echo "Error: Could not extract version from Cargo.toml"
exit 1
fi

echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"

- name: Update version badges in all markdown files
run: |
VERSION="${{ steps.get_version.outputs.version }}"
echo "Updating badges to version: $VERSION"

# Find all markdown files and update the version badge
find . -name "*.md" -type f | while read -r file; do
echo "Checking file: $file"
if grep -q "img.shields.io/badge/Version-" "$file"; then
echo "Updating badge in: $file"
sed -i "s|https://img\.shields\.io/badge/Version-[^-]*-informational|https://img.shields.io/badge/Version-$VERSION-informational|g" "$file"
fi
done

- name: Check for changes
id: check_changes
run: |
if git diff --quiet; then
echo "changes=false" >> $GITHUB_OUTPUT
echo "No changes detected"
else
echo "changes=true" >> $GITHUB_OUTPUT
echo "Changes detected:"
git diff --name-only
fi

- name: Commit and push changes
if: steps.check_changes.outputs.changes == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "🔖 Update version badge to v${{ steps.get_version.outputs.version }}"
git push
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div align="center">
<img src="https://img.shields.io/badge/Rust-dea584?style=for-the-badge&logo=rust&logoColor=white" alt="Rust" />
<img src="https://img.shields.io/badge/Tauri-ffc130?style=for-the-badge&logo=tauri&logoColor=white" alt="Tauri" />
<img src="https://img.shields.io/badge/Version-1.0.3-7073f6?style=for-the-badge" alt="Version" />
<img src="https://img.shields.io/badge/Version-1.0.4-7073f6?style=for-the-badge" alt="Version" />
</div>
</div>

Expand Down Expand Up @@ -78,6 +78,32 @@ To quickly test FileFlow:
4. **Upload and Insert**: Upload your CSV file and start the insertion process. Monitor progress with the on-screen
loader.

## 🧪 Code Quality

### Unit Tests available

To run unit tests, use the following command:

#### For the Rust backend:

```bash
cargo test
```

#### For the Tauri frontend:

```bash
pnpm test
```

### Benchmarks available

To run benchmarks, use the following command:

```bash
cargo bench
```

## 🤝 Contributing

Contributions are welcome! To contribute:
Expand Down
31 changes: 31 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export default {
preset: 'ts-jest/presets/default-esm',
extensionsToTreatAsEsm: ['.ts', '.tsx'],
testEnvironment: 'node',
roots: ['<rootDir>/src'],
testMatch: [
'**/__tests__/**/*.+(ts|tsx|js)',
'**/*.(test|spec).+(ts|tsx|js)'
],
transform: {
'^.+\\.(ts|tsx)$': ['ts-jest', {
useESM: true
}]
},
moduleNameMapping: {
'^(\\.{1,2}/.*)\\.js$': '$1'
},
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
'!src/**/*.test.{ts,tsx}'
],
coverageThreshold: {
global: {
branches: 90,
functions: 90,
lines: 90,
statements: 90
}
}
};
44 changes: 25 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,32 @@
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"tauri": "tauri"
"tauri": "tauri",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage"
},
"dependencies": {
"@radix-ui/react-checkbox": "^1.3.2",
"@radix-ui/react-dialog": "^1.1.14",
"@radix-ui/react-dropdown-menu": "^2.1.15",
"@radix-ui/react-checkbox": "^1.3.3",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-icons": "^1.3.2",
"@radix-ui/react-label": "^2.1.7",
"@radix-ui/react-menubar": "^1.1.15",
"@radix-ui/react-popover": "^1.1.14",
"@radix-ui/react-radio-group": "^1.3.7",
"@radix-ui/react-select": "^2.2.5",
"@radix-ui/react-menubar": "^1.1.16",
"@radix-ui/react-popover": "^1.1.15",
"@radix-ui/react-radio-group": "^1.3.8",
"@radix-ui/react-select": "^2.2.6",
"@radix-ui/react-separator": "^1.1.7",
"@radix-ui/react-slot": "^1.2.3",
"@radix-ui/react-switch": "^1.2.5",
"@radix-ui/react-tabs": "^1.1.12",
"@radix-ui/react-tooltip": "^1.2.7",
"@tauri-apps/api": "^2.5.0",
"@radix-ui/react-switch": "^1.2.6",
"@radix-ui/react-tabs": "^1.1.13",
"@radix-ui/react-tooltip": "^1.2.8",
"@tauri-apps/api": "^2.8.0",
"@tauri-apps/plugin-dialog": "~2.2.2",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "1.0.0",
"framer-motion": "^12.17.0",
"framer-motion": "^12.23.18",
"lucide-react": "^0.441.0",
"next-themes": "^0.4.6",
"react": "^18.3.1",
Expand All @@ -40,15 +43,18 @@
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@tauri-apps/cli": "^2.5.0",
"@types/node": "^22.15.31",
"@types/react": "^18.3.23",
"@tauri-apps/cli": "^2.8.4",
"@types/jest": "^29.5.14",
"@types/node": "^22.18.6",
"@types/react": "^18.3.24",
"@types/react-dom": "^18.3.7",
"@vitejs/plugin-react": "^4.5.2",
"@vitejs/plugin-react": "^4.7.0",
"autoprefixer": "^10.4.21",
"postcss": "^8.5.4",
"jest": "^29.7.0",
"postcss": "^8.5.6",
"tailwindcss": "^3.4.17",
"typescript": "^5.8.3",
"ts-jest": "^29.4.4",
"typescript": "^5.9.2",
"vite": "^5.4.20"
}
}
Loading
Loading