From 3bf384e9e411aca983dad5fa6e2413ba69dc20b1 Mon Sep 17 00:00:00 2001 From: Richard Baah Date: Tue, 11 Nov 2025 01:56:26 -0500 Subject: [PATCH] Added lots of configuration and documentation to start the project --- .github/workflows/go-test.yml | 36 ++- .github/workflows/rust-test.yml | 44 ++++ CONTRIBUTING.md | 155 +++++++++++++ LICENSE.txt | 209 ++++++++++++++++++ Makefile | 100 +++++++++ README.md | 136 +++++++++++- src/Backend/opti-sql-go/go.mod | 2 +- .../physical-optimizer/optimize.go | 2 + src/Backend/opti-sql-rs/src/main.rs | 8 +- src/Backend/opti-sql-rs/src/project/mod.rs | 4 +- .../opti-sql-rs/src/project/source/csv.rs | 1 - .../opti-sql-rs/src/project/source/json.rs | 1 + .../opti-sql-rs/src/project/source/mod.rs | 2 +- .../opti-sql-rs/src/project/source/parquet.rs | 3 +- 14 files changed, 685 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/rust-test.yml create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE.txt create mode 100644 Makefile diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index b0d707b..63652ce 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -7,6 +7,23 @@ on: branches: [ main ] jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.24' + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: latest + working-directory: ./src/Backend/opti-sql-go + test: runs-on: ubuntu-latest @@ -16,16 +33,23 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: '1.24' - name: Run tests working-directory: ./src/Backend/opti-sql-go run: go test -v ./... - - name: Run tests with coverage - working-directory: ./src/Backend/opti-sql-go - run: go test -v -coverprofile=coverage.out ./... + race: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.24' - - name: Display coverage + - name: Run tests with race detector working-directory: ./src/Backend/opti-sql-go - run: go tool cover -func=coverage.out + run: go test -race -v ./... diff --git a/.github/workflows/rust-test.yml b/.github/workflows/rust-test.yml new file mode 100644 index 0000000..a67656b --- /dev/null +++ b/.github/workflows/rust-test.yml @@ -0,0 +1,44 @@ +name: Rust Tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + components: clippy, rustfmt + + - name: Run clippy + working-directory: ./src/Backend/opti-sql-rs + run: cargo clippy --all-targets --all-features -- -D warnings + + - name: Check formatting + working-directory: ./src/Backend/opti-sql-rs + run: cargo fmt -- --check + + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + + - name: Run tests + working-directory: ./src/Backend/opti-sql-rs + run: cargo test --verbose + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..7e5fd6c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,155 @@ +# Contributing to OptiSQL + +Thank you for your interest in contributing to OptiSQL! This guide will help you get started. + +## How to Write and Run Tests + +We use a Makefile to simplify common development tasks. All commands should be run from the project root. + +### Go Tests +- Run all tests + ```bash + make go-test + ``` +- Run tests with race detector + ```bash + make go-test-race + ``` +- Run tests with coverage + ```bash + make go-test-coverage + ``` + +### Rust Tests +- Run all tests + ```bash + make rust-test + ``` + +### Run All Tests (Go + Rust) +- Run tests for both backends + ```bash + make test-all + ``` + +## Pull Request (PR) Format + +- Create a descriptive PR title that summarizes the change +- Include the following sections in your PR description: + - **What**: Brief description of what this PR does + - **Why**: Explanation of why this change is needed + - **How**: Technical details of how the change was implemented + - **Testing**: How you tested the changes +- Reference any related issues using `Fixes #` or `Closes #` +- Ensure all CI checks pass + +## Git Commit Message Format + +- Use conventional commit format: + ```bash + (): + + + +