Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
143 changes: 143 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: CI

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
cc: gcc
- os: macos-latest
cc: clang

steps:
- uses: actions/checkout@v4

- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y valgrind build-essential

- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install valgrind || echo "Valgrind not available on macOS ARM"

- name: Set up environment
run: |
echo "CC=${{ matrix.cc }}" >> $GITHUB_ENV

- name: Build library
run: |
make clean
make

- name: Verify build artifacts
run: |
ls -la *.so *.a
file libcsv.so libcsv.a

- name: Build tests
run: |
make tests

- name: Run tests
run: |
make test

- name: Run Valgrind tests (Ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
make valgrind

- name: Test individual components
run: |
make test-arena
make test-config
make test-utils
make test-parser
make test-writer
make test-reader

memory-safety:
name: Memory Safety Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind

- name: Build with debug info
run: |
make clean
CFLAGS="-g -O0" make

- name: Run comprehensive Valgrind tests
run: |
make valgrind-all

- name: Check for memory leaks
run: |
echo "✅ All Valgrind tests passed - no memory leaks detected"

cross-compile:
name: Cross Compilation Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install cross-compilation tools
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf

- name: Cross compile for ARM64
run: |
CC=aarch64-linux-gnu-gcc make clean all

- name: Cross compile for ARM32
run: |
CC=arm-linux-gnueabihf-gcc make clean all

release-test:
name: Release Build Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Build optimized release
run: |
CFLAGS="-O3 -DNDEBUG" make clean all

- name: Test optimized build
run: |
make test

- name: Create distribution package
run: |
mkdir -p dist/FastCSV-C
cp *.h *.c Makefile LICENSE README.md CONTRIBUTING.md dist/FastCSV-C/
cp -r tests dist/FastCSV-C/
cd dist && tar -czf FastCSV-C.tar.gz FastCSV-C/

- name: Upload distribution artifact
uses: actions/upload-artifact@v4
with:
name: FastCSV-C-dist
path: dist/FastCSV-C.tar.gz
69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Build release artifacts
run: |
make clean
CFLAGS="-O3 -DNDEBUG" make

- name: Run tests
run: |
make test

- name: Create source distribution
run: |
mkdir -p dist/FastCSV-C-${GITHUB_REF#refs/tags/}
cp *.h *.c Makefile LICENSE README.md CONTRIBUTING.md dist/FastCSV-C-${GITHUB_REF#refs/tags/}/
cp -r tests dist/FastCSV-C-${GITHUB_REF#refs/tags/}/
cd dist && tar -czf FastCSV-C-${GITHUB_REF#refs/tags/}.tar.gz FastCSV-C-${GITHUB_REF#refs/tags/}/

- name: Create binary distribution
run: |
mkdir -p dist/FastCSV-C-${GITHUB_REF#refs/tags/}-linux-x64
cp *.h libcsv.so libcsv.a LICENSE README.md dist/FastCSV-C-${GITHUB_REF#refs/tags/}-linux-x64/
cd dist && tar -czf FastCSV-C-${GITHUB_REF#refs/tags/}-linux-x64.tar.gz FastCSV-C-${GITHUB_REF#refs/tags/}-linux-x64/

- name: Create Release
uses: softprops/action-gh-release@v1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Update to latest action version.

The softprops/action-gh-release@v1 action is outdated and may not work properly on current GitHub Actions runners.

-      uses: softprops/action-gh-release@v1
+      uses: softprops/action-gh-release@v2
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
🧰 Tools
🪛 actionlint (1.7.7)

39-39: the runner of "softprops/action-gh-release@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In .github/workflows/release.yml at line 39, the GitHub Action
'softprops/action-gh-release@v1' is outdated. Update this to the latest stable
version, such as 'softprops/action-gh-release@v2' or the current recommended
version, to ensure compatibility and proper functionality with current GitHub
Actions runners.

with:
files: |
dist/FastCSV-C-*.tar.gz
body: |
## FastCSV-C Release ${{ github.ref_name }}

### Features
- High-performance CSV parsing and writing
- Memory-safe with zero leaks (Valgrind validated)
- Arena-based memory management
- Comprehensive test suite (42+ tests)

### Downloads
- **Source Code**: FastCSV-C-${{ github.ref_name }}.tar.gz
- **Linux Binary**: FastCSV-C-${{ github.ref_name }}-linux-x64.tar.gz

### Installation
```bash
tar -xzf FastCSV-C-${{ github.ref_name }}.tar.gz
cd FastCSV-C-${{ github.ref_name }}
make
make test
```

### What's Changed
See the commit history for detailed changes in this release.
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87 changes: 34 additions & 53 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,64 +1,45 @@
# Build directories
build/
_build/
cmake-build-*/

# Object files
# Build artifacts
*.o
*.ko
*.obj
*.elf

# Libraries
*.lib
*.so
*.a
*.la
*.d
*.debug.o
*.gcov.o
*.gcno
*.gcda
*.dep
*.lo
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Test executables
test_arena
test_csv_config
test_csv_utils
test_csv_parser
test_csv_writer
test_csv_reader
run_all_tests

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Dependency files
*.d

# CMake
CMakeCache.txt
CMakeFiles/
CMakeScripts/
Testing/
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
# Build directories
build/
dist/
coverage.info
profile.txt
gmon.out
scan-build-results/

# Temporary files
*.tmp
*.temp
*~

# IDE specific files
.idea/
# IDE files
.vscode/
.idea/
*.swp
*.swo
*~

# OS specific files
# OS files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
*.dep

# Test CSV files generated during testing
test_*.csv
75 changes: 0 additions & 75 deletions CMakeLists.txt

This file was deleted.

Loading
Loading