Skip to content

Commit 651528d

Browse files
committed
Merge branch 'main' of github.com:solve-ease/OptiBlogAi
2 parents f3e81d0 + 9d1392b commit 651528d

9 files changed

Lines changed: 1438 additions & 2 deletions

File tree

.github/dependabot.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for Python dependencies
4+
- package-ecosystem: "pip"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
time: "09:00"
10+
open-pull-requests-limit: 10
11+
reviewers:
12+
- "solve-ease"
13+
assignees:
14+
- "solve-ease"
15+
commit-message:
16+
prefix: "deps"
17+
include: "scope"
18+
19+
# Enable version updates for Node.js dependencies in optiblogai-site
20+
- package-ecosystem: "npm"
21+
directory: "/optiblogai-site"
22+
schedule:
23+
interval: "weekly"
24+
day: "monday"
25+
time: "09:00"
26+
open-pull-requests-limit: 10
27+
reviewers:
28+
- "solve-ease"
29+
assignees:
30+
- "solve-ease"
31+
commit-message:
32+
prefix: "deps"
33+
include: "scope"
34+
35+
# Enable version updates for GitHub Actions
36+
- package-ecosystem: "github-actions"
37+
directory: "/"
38+
schedule:
39+
interval: "weekly"
40+
day: "monday"
41+
time: "09:00"
42+
open-pull-requests-limit: 5
43+
reviewers:
44+
- "solve-ease"
45+
assignees:
46+
- "solve-ease"
47+
commit-message:
48+
prefix: "ci"
49+
include: "scope"
50+
51+
# Enable version updates for Docker
52+
- package-ecosystem: "docker"
53+
directory: "/"
54+
schedule:
55+
interval: "weekly"
56+
day: "monday"
57+
time: "09:00"
58+
open-pull-requests-limit: 5
59+
reviewers:
60+
- "solve-ease"
61+
assignees:
62+
- "solve-ease"
63+
commit-message:
64+
prefix: "docker"
65+
include: "scope"

.github/workflows/ci-cd.yml

Whitespace-only changes.

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
paths:
7+
- 'optiblogai-site/**'
8+
- '.github/workflows/ci.yml'
9+
pull_request:
10+
branches: [ main, develop ]
11+
paths:
12+
- 'optiblogai-site/**'
13+
- '.github/workflows/ci.yml'
14+
15+
defaults:
16+
run:
17+
working-directory: ./optiblogai-site
18+
19+
jobs:
20+
lint-and-test:
21+
runs-on: ubuntu-latest
22+
23+
strategy:
24+
matrix:
25+
node-version: [18.x, 20.x]
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Use Node.js ${{ matrix.node-version }}
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
cache: 'npm'
36+
cache-dependency-path: './optiblogai-site/package-lock.json'
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
41+
- name: Run ESLint
42+
run: npm run lint
43+
44+
- name: Check TypeScript types
45+
run: npx tsc --noEmit
46+
47+
- name: Run tests (if test script exists)
48+
run: |
49+
if npm run | grep -q "test"; then
50+
npm test
51+
else
52+
echo "No test script found, skipping tests"
53+
fi
54+
env:
55+
CI: true
56+
57+
- name: Build application
58+
run: npm run build
59+
60+
- name: Upload build artifacts
61+
uses: actions/upload-artifact@v4
62+
if: matrix.node-version == '20.x'
63+
with:
64+
name: build-files
65+
path: ./optiblogai-site/.next/
66+
retention-days: 7

.github/workflows/codeql.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
schedule:
9+
- cron: '22 23 * * 0' # Run weekly on Sundays at 23:22 UTC
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [ 'python', 'javascript' ]
24+
# CodeQL supports 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby'
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v3
32+
with:
33+
languages: ${{ matrix.language }}
34+
# If you wish to specify custom queries, you can do so here or in a config file.
35+
# By default, queries listed here will override any specified in a config file.
36+
# Prefix the list here with "+" to use these queries and those in the config file.
37+
# queries: security-extended,security-and-quality
38+
39+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
40+
# If this step fails, then you should remove it and run the build manually (see below)
41+
- name: Autobuild
42+
uses: github/codeql-action/autobuild@v3
43+
44+
# ℹ️ Command-line programs to run using the OS shell.
45+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
46+
47+
# If the Autobuild fails above, remove it and uncomment the following three lines
48+
# and modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
49+
50+
# - run: |
51+
# echo "Run, Build Application using script"
52+
# ./location_of_script_within_repo/buildscript.sh
53+
54+
- name: Perform CodeQL Analysis
55+
uses: github/codeql-action/analyze@v3
56+
with:
57+
category: "/language:${{matrix.language}}"

.github/workflows/python-ci.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Python CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
paths:
7+
- 'src/**'
8+
- 'tests/**'
9+
- 'requirements.txt'
10+
- '.github/workflows/python-ci.yml'
11+
pull_request:
12+
branches: [ main, develop ]
13+
paths:
14+
- 'src/**'
15+
- 'tests/**'
16+
- 'requirements.txt'
17+
- '.github/workflows/python-ci.yml'
18+
19+
jobs:
20+
test:
21+
runs-on: ubuntu-latest
22+
23+
strategy:
24+
matrix:
25+
python-version: ['3.12']
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Set up Python ${{ matrix.python-version }}
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
36+
- name: Cache pip dependencies
37+
uses: actions/cache@v4
38+
with:
39+
path: ~/.cache/pip
40+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
41+
restore-keys: |
42+
${{ runner.os }}-pip-
43+
44+
- name: Install dependencies
45+
run: |
46+
python -m pip install --upgrade pip
47+
pip install -r requirements.txt
48+
pip install pytest pytest-cov flake8 black isort
49+
50+
- name: Lint with flake8
51+
run: |
52+
# stop the build if there are Python syntax errors or undefined names
53+
flake8 src --count --select=E9,F63,F7,F82 --show-source --statistics
54+
# exit-zero treats all errors as warnings
55+
flake8 src --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
56+
57+
- name: Check code formatting with black
58+
run: |
59+
black --check src tests
60+
61+
- name: Check import sorting with isort
62+
run: |
63+
isort --check-only src tests
64+
65+
- name: Run tests with pytest
66+
run: |
67+
if [ "$(find tests/ -name "*.py" -exec grep -l "def test_" {} \; | wc -l)" -gt 0 ]; then
68+
pytest tests/ --cov=src --cov-report=xml --cov-report=term-missing
69+
else
70+
echo "No tests found with test functions, skipping test execution"
71+
echo "Creating empty coverage.xml for consistency"
72+
echo '<?xml version="1.0" ?><coverage version="0.0" timestamp="0" lines-valid="0" lines-covered="0" line-rate="0.0"></coverage>' > coverage.xml
73+
fi
74+
75+
- name: Upload coverage to Codecov
76+
uses: codecov/codecov-action@v4
77+
if: matrix.python-version == '3.12'
78+
with:
79+
file: ./coverage.xml
80+
flags: unittests
81+
name: codecov-umbrella
82+
fail_ci_if_error: false

.gitignore

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,32 @@ src/.env
22
.myenv
33
src/extracted_content
44

5+
# Python cache
56
src/scraper/__pycache__
7+
tests/**/__pycache__
8+
**/__pycache__/
9+
*.py[cod]
10+
*$py.class
11+
12+
# Coverage reports
13+
.coverage
14+
.coverage.*
15+
coverage.xml
16+
*.cover
17+
.hypothesis/
18+
.pytest_cache/
619

720
.env
8-
src/.env
9-
myenv
21+
myenv
22+
23+
# Node.js dependencies
24+
node_modules/
25+
npm-debug.log*
26+
yarn-debug.log*
27+
yarn-error.log*
28+
29+
# Build outputs
30+
.next/
31+
out/
32+
dist/
33+
build/

0 commit comments

Comments
 (0)