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
41 changes: 2 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,6 @@ jobs:
- name: Install ruff
run: pip install ruff
- name: Ruff check
run: ruff check python/
run: ruff check .
- name: Ruff format check
run: ruff format --check python/

lint-typescript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Check TypeScript syntax
run: |
for dir in node/*/; do
if [ -f "$dir/package.json" ]; then
echo "Checking $dir..."
cd "$dir"
npm install --ignore-scripts 2>/dev/null || true
npx tsc --noEmit 2>/dev/null || echo "No tsconfig in $dir"
cd -
fi
done

lint-go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Check Go syntax
run: |
for dir in go/*/; do
if [ -f "$dir/go.mod" ]; then
echo "Checking $dir..."
cd "$dir"
go vet ./... 2>/dev/null || echo "go vet issues in $dir"
cd -
fi
done
run: ruff format --check .
294 changes: 5 additions & 289 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,8 @@ concurrency:
cancel-in-progress: true

jobs:
python-examples:
verify:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
category:
- pycubrid
- sqlalchemy
- fastapi
- flask
- django
- pandas
- celery
- streamlit
services:
cubrid:
image: cubrid/cubrid:11.2
Expand All @@ -48,8 +36,8 @@ jobs:
with:
python-version: "3.12"

- name: Install pycubrid for readiness check
run: pip install pycubrid
- name: Install dependencies
run: pip install pycubrid sqlalchemy sqlalchemy-cubrid

- name: Wait for CUBRID readiness
run: |
Expand All @@ -74,277 +62,5 @@ jobs:
sleep 5
done

- name: Install requirements for ${{ matrix.category }}
run: |
req_file="python/${{ matrix.category }}/requirements.txt"
if [ -f "$req_file" ]; then
pip install -r "$req_file"
fi

- name: Run ${{ matrix.category }} examples
id: run_category
continue-on-error: true
run: |
set +e
passed=0
failed=0

run_example() {
file="$1"
echo "Running $file"
if python "$file"; then
passed=$((passed + 1))
else
failed=$((failed + 1))
fi
}

case "${{ matrix.category }}" in
pycubrid|sqlalchemy)
for file in python/${{ matrix.category }}/*.py; do
run_example "$file"
done
;;
pandas)
run_example "python/pandas/seed_data.py"
for file in python/pandas/[0-9][0-9]_*.py; do
run_example "$file"
done
;;
fastapi)
echo "Import check: app.main"
if PYTHONPATH=python/fastapi python -c "import app.main"; then
passed=$((passed + 1))
else
failed=$((failed + 1))
fi
;;
flask)
echo "Import check: run"
if PYTHONPATH=python/flask python -c "import run"; then
passed=$((passed + 1))
else
failed=$((failed + 1))
fi
;;
django)
echo "Import check: manage + settings"
if PYTHONPATH=python/django python -c "import manage; import cubrid_project.settings"; then
passed=$((passed + 1))
else
failed=$((failed + 1))
fi
;;
celery)
echo "Import check: app + run_tasks"
if PYTHONPATH=python/celery python -c "import app; import run_tasks"; then
passed=$((passed + 1))
else
failed=$((failed + 1))
fi
;;
streamlit)
echo "Import check: app"
if PYTHONPATH=python/streamlit python -c "import app"; then
passed=$((passed + 1))
else
failed=$((failed + 1))
fi
;;
esac

echo "passed=$passed" >> "$GITHUB_OUTPUT"
echo "failed=$failed" >> "$GITHUB_OUTPUT"

if [ "$failed" -gt 0 ]; then
exit 1
fi

- name: Print summary for ${{ matrix.category }}
if: always()
run: |
echo "Python category: ${{ matrix.category }}"
echo "Passed: ${{ steps.run_category.outputs.passed || '0' }}"
echo "Failed: ${{ steps.run_category.outputs.failed || '0' }}"
{
echo "### Python smoke summary (${{ matrix.category }})"
echo "- Passed: ${{ steps.run_category.outputs.passed || '0' }}"
echo "- Failed: ${{ steps.run_category.outputs.failed || '0' }}"
} >> "$GITHUB_STEP_SUMMARY"
if [ "${{ steps.run_category.outcome }}" != "success" ]; then
exit 1
fi

node-examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example_set:
- cubrid
- drizzle
services:
cubrid:
image: cubrid/cubrid:11.2
env:
CUBRID_DB: testdb
ports:
- 33000:33000
options: >-
--health-cmd "csql -u dba testdb -c 'SELECT 1'"
--health-interval 15s
--health-timeout 10s
--health-retries 10
--health-start-period 30s
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"

- name: Ensure ESM mode in package.json
run: |
node -e "
const fs = require('fs');
const path = 'node/${{ matrix.example_set }}/package.json';
const pkg = JSON.parse(fs.readFileSync(path, 'utf8'));
if (pkg.type !== 'module') {
console.error(path + ' must include \"type\": \"module\"');
process.exit(1);
}
console.log(path + ' is configured for ESM');
"

- name: Wait for CUBRID readiness
run: |
for i in $(seq 1 30); do
if node -e "
const net = require('net');
const s = net.createConnection(33000, 'localhost');
s.on('connect', () => { s.destroy(); process.exit(0); });
s.on('error', () => process.exit(1));
setTimeout(() => process.exit(1), 5000);
"; then break; fi
echo "Waiting... ($i/30)"
sleep 5
done

- name: Install dependencies
run: npm install
working-directory: node/${{ matrix.example_set }}

- name: Run ${{ matrix.example_set }} examples
run: |
set +e
passed=0
failed=0

for file in node/${{ matrix.example_set }}/*.js; do
echo "Running $file"
if node "$file"; then
passed=$((passed + 1))
else
failed=$((failed + 1))
fi
done

echo "Node example set: ${{ matrix.example_set }}"
echo "Passed: $passed"
echo "Failed: $failed"
{
echo "### Node smoke summary (${{ matrix.example_set }})"
echo "- Passed: $passed"
echo "- Failed: $failed"
} >> "$GITHUB_STEP_SUMMARY"

if [ "$failed" -gt 0 ]; then
exit 1
fi

go-examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example_set:
- cubrid-go
- gorm
services:
cubrid:
image: cubrid/cubrid:11.2
env:
CUBRID_DB: testdb
ports:
- 33000:33000
options: >-
--health-cmd "csql -u dba testdb -c 'SELECT 1'"
--health-interval 15s
--health-timeout 10s
--health-retries 10
--health-start-period 30s
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"

- name: Wait for CUBRID readiness
run: |
for i in $(seq 1 30); do
if python -c "
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(5)
try:
s.connect(('localhost', 33000))
s.close()
print('CUBRID ready')
exit(0)
except Exception:
exit(1)
"; then
break
fi
echo "Waiting... ($i/30)"
sleep 5
done

- name: Build ${{ matrix.example_set }} examples
run: go build ./...
working-directory: go/${{ matrix.example_set }}

- name: Compile Go examples in ${{ matrix.example_set }}
working-directory: go/${{ matrix.example_set }}
run: |
set +e
passed=0
failed=0

for file in *.go; do
[ "$file" = "*.go" ] && break
echo "Compiling $file"
if go build -o /dev/null "$file"; then
passed=$((passed + 1))
else
failed=$((failed + 1))
fi
done

echo "Go example set: ${{ matrix.example_set }}"
echo "Compiled: $passed"
echo "Failed: $failed"
{
echo "### Go smoke summary (${{ matrix.example_set }})"
echo "- Compiled: $passed"
echo "- Failed: $failed"
} >> "$GITHUB_STEP_SUMMARY"

if [ "$failed" -gt 0 ]; then
exit 1
fi
- name: Run make verify
run: make verify
Loading
Loading