Skip to content

Commit ff870ac

Browse files
fix: update CI workflows for Node.js environment
1 parent 2ba8ec1 commit ff870ac

File tree

2 files changed

+31
-101
lines changed

2 files changed

+31
-101
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -15,95 +15,43 @@ jobs:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
1717

18-
- name: Set up Python
19-
uses: actions/setup-python@v5
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
2020
with:
21-
python-version: '3.11'
21+
node-version: '20'
22+
cache: 'npm'
2223

23-
- name: Cache pip packages
24-
uses: actions/cache@v4
25-
with:
26-
path: ~/.cache/pip
27-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
28-
restore-keys: |
29-
${{ runner.os }}-pip-
30-
3124
- name: Install dependencies
32-
run: |
33-
python -m pip install --upgrade pip
34-
pip install flake8 black isort mypy pylint
35-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
36-
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
37-
38-
- name: Run Black (Code Formatter Check)
39-
run: |
40-
black --check --diff src/ tests/ || true
25+
run: npm ci
4126

42-
- name: Run isort (Import Sorting Check)
43-
run: |
44-
isort --check-only --diff src/ tests/ || true
45-
46-
- name: Run Flake8 (Linting)
47-
run: |
48-
flake8 src/ tests/ --count --select=E9,F63,F7,F82 --show-source --statistics
49-
flake8 src/ tests/ --count --exit-zero --max-complexity=10 --max-line-length=100 --statistics
50-
51-
- name: Run MyPy (Type Checking)
52-
run: |
53-
mypy src/ --ignore-missing-imports || true
54-
55-
- name: Run Pylint
56-
run: |
57-
pylint src/ --exit-zero || true
27+
- name: Run ESLint
28+
run: npm run lint || true
5829

5930
test:
60-
name: Test on ${{ matrix.os }} - Python ${{ matrix.python-version }}
31+
name: Test on ${{ matrix.os }} - Node ${{ matrix.node-version }}
6132
runs-on: ${{ matrix.os }}
6233

6334
strategy:
6435
fail-fast: false
6536
matrix:
6637
os: [ubuntu-latest, windows-latest, macos-latest]
67-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
38+
node-version: ['18', '20', '22', '24']
6839

6940
steps:
7041
- name: Checkout code
7142
uses: actions/checkout@v4
7243

73-
- name: Set up Python ${{ matrix.python-version }}
74-
uses: actions/setup-python@v5
44+
- name: Set up Node.js ${{ matrix.node-version }}
45+
uses: actions/setup-node@v4
7546
with:
76-
python-version: ${{ matrix.python-version }}
47+
node-version: ${{ matrix.node-version }}
48+
cache: 'npm'
7749

78-
- name: Cache pip packages
79-
uses: actions/cache@v4
80-
with:
81-
path: ~/.cache/pip
82-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
83-
restore-keys: |
84-
${{ runner.os }}-pip-
85-
8650
- name: Install dependencies
87-
run: |
88-
python -m pip install --upgrade pip
89-
pip install pytest pytest-cov pytest-xdist
90-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
91-
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
92-
shell: bash
51+
run: npm ci
9352

94-
- name: Run tests with coverage
95-
run: |
96-
pytest tests/ --cov=src --cov-report=xml --cov-report=html --cov-report=term -v || true
97-
shell: bash
98-
99-
- name: Upload coverage to Codecov
100-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
101-
uses: codecov/codecov-action@v4
102-
with:
103-
file: ./coverage.xml
104-
flags: unittests
105-
name: codecov-umbrella
106-
fail_ci_if_error: false
53+
- name: Run build
54+
run: npm run build || true
10755

10856
security:
10957
name: Security Scan
@@ -113,33 +61,17 @@ jobs:
11361
- name: Checkout code
11462
uses: actions/checkout@v4
11563

116-
- name: Set up Python
117-
uses: actions/setup-python@v5
64+
- name: Set up Node.js
65+
uses: actions/setup-node@v4
11866
with:
119-
python-version: '3.11'
67+
node-version: '20'
68+
cache: 'npm'
12069

12170
- name: Install dependencies
122-
run: |
123-
python -m pip install --upgrade pip
124-
pip install bandit safety
125-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
71+
run: npm ci
12672

127-
- name: Run Bandit (Security Linter)
128-
run: |
129-
bandit -r src/ -f json -o bandit-report.json || true
130-
bandit -r src/ || true
131-
132-
- name: Run Safety (Dependency Security Check)
133-
run: |
134-
safety check --json || true
135-
safety check || true
136-
137-
- name: Upload Bandit report
138-
uses: actions/upload-artifact@v4
139-
if: always()
140-
with:
141-
name: bandit-security-report
142-
path: bandit-report.json
73+
- name: Run npm audit
74+
run: npm audit --audit-level=moderate || true
14375

14476
build:
14577
name: Build Package
@@ -150,19 +82,17 @@ jobs:
15082
- name: Checkout code
15183
uses: actions/checkout@v4
15284

153-
- name: Set up Python
154-
uses: actions/setup-python@v5
85+
- name: Set up Node.js
86+
uses: actions/setup-node@v4
15587
with:
156-
python-version: '3.11'
88+
node-version: '20'
89+
cache: 'npm'
15790

158-
- name: Install build dependencies
159-
run: |
160-
python -m pip install --upgrade pip
161-
pip install build wheel setuptools
91+
- name: Install dependencies
92+
run: npm ci
16293

16394
- name: Build package
164-
run: |
165-
python -m build || echo "Build configuration not yet set up"
95+
run: npm run build
16696

16797
- name: Upload build artifacts
16898
uses: actions/upload-artifact@v4

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
language: [ 'python' ]
23+
language: [ 'javascript' ]
2424

2525
steps:
2626
- name: Checkout repository

0 commit comments

Comments
 (0)