Skip to content

Commit 0814388

Browse files
committed
update workflow
1 parent c9fa7de commit 0814388

File tree

7 files changed

+19
-51
lines changed

7 files changed

+19
-51
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Nutrient DWS Processor API Configuration for Testing
2+
NUTRIENT_API_KEY=your_api_key_here
3+
NUTRIENT_BASE_URL=https://api.nutrient.io

.github/workflows/ci.yml

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@ jobs:
1818
with:
1919
python-version: '3.12'
2020
cache: 'pip'
21-
cache-dependency-path: 'pyproject.toml'
2221

2322
- name: Install dependencies
2423
run: |
25-
python -m pip install --upgrade pip
26-
pip install -e ".[dev]"
24+
pip install ".[dev]"
2725
2826
- name: Run linting
2927
run: |
3028
python -m ruff check src/
31-
python -m ruff format --check src/
3229
3330
- name: Run type checking
3431
run: python -m mypy src/
@@ -50,12 +47,10 @@ jobs:
5047
with:
5148
python-version: ${{ matrix.python-version }}
5249
cache: 'pip'
53-
cache-dependency-path: 'pyproject.toml'
5450

5551
- name: Install dependencies
5652
run: |
57-
python -m pip install --upgrade pip
58-
pip install -e ".[dev]"
53+
pip install ".[dev]"
5954
6055
- name: Run unit tests with coverage
6156
run: python -m pytest tests/unit/ -v --cov=nutrient_dws --cov-report=xml --cov-report=term
@@ -64,7 +59,6 @@ jobs:
6459
uses: codecov/codecov-action@v4
6560
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
6661
with:
67-
token: ${{ secrets.CODECOV_TOKEN }}
6862
files: ./coverage.xml
6963
flags: unittests
7064
name: codecov-umbrella
@@ -81,28 +75,13 @@ jobs:
8175
with:
8276
python-version: '3.12'
8377
cache: 'pip'
84-
cache-dependency-path: 'pyproject.toml'
8578

8679
- name: Install dependencies
8780
run: |
88-
python -m pip install --upgrade pip
89-
pip install -e ".[dev]"
81+
pip install ".[dev]"
9082
9183
- name: Build package
9284
run: python -m build
9385

9486
- name: Verify build outputs
95-
run: |
96-
ls -la dist/
97-
test -f dist/*.whl
98-
test -f dist/*.tar.gz
99-
100-
- name: Check package with twine
10187
run: twine check dist/*
102-
103-
- name: Upload build artifacts
104-
uses: actions/upload-artifact@v4
105-
with:
106-
name: dist-${{ github.run_number }}
107-
path: dist/
108-
retention-days: 30

.github/workflows/integration-tests.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ jobs:
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525
cache: 'pip'
26-
cache-dependency-path: 'pyproject.toml'
2726

2827
- name: Install dependencies
2928
run: |
30-
python -m pip install --upgrade pip
31-
pip install -e ".[dev]"
29+
pip install ".[dev]"
3230
3331
- name: Check for API key
3432
id: check-api-key
@@ -47,7 +45,7 @@ jobs:
4745
if: steps.check-api-key.outputs.has_api_key == 'true'
4846
env:
4947
NUTRIENT_API_KEY: ${{ secrets.NUTRIENT_API_KEY }}
50-
run: python -m pytest tests/integration/ -v
48+
run: python -m pytest tests/integration.py -v
5149

5250
- name: Skip integration tests (no API key)
5351
if: steps.check-api-key.outputs.has_api_key == 'false'

.github/workflows/scheduled-integration-tests.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,18 @@ jobs:
1818
with:
1919
python-version: '3.12'
2020
cache: 'pip'
21-
cache-dependency-path: 'pyproject.toml'
2221

2322
- name: Install dependencies
2423
run: |
25-
python -m pip install --upgrade pip
26-
pip install -e ".[dev]"
24+
pip install ".[dev]"
2725
2826
- name: Run all integration tests
2927
if: secrets.NUTRIENT_API_KEY != ''
3028
env:
3129
NUTRIENT_API_KEY: ${{ secrets.NUTRIENT_API_KEY }}
3230
run: |
3331
echo "Running scheduled integration tests to detect API changes..."
34-
python -m pytest tests/integration/ -v --tb=short
32+
python -m pytest tests/integration.py -v --tb=short
3533
timeout-minutes: 20
3634
continue-on-error: true
3735
id: test-run
@@ -45,7 +43,7 @@ jobs:
4543
- name: Generate detailed test report
4644
if: always()
4745
run: |
48-
python -m pytest tests/integration/ -v --tb=short --junit-xml=scheduled-test-results.xml || true
46+
python -m pytest tests/integration.py -v --tb=short --junit-xml=scheduled-test-results.xml || true
4947
5048
# Create summary
5149
echo "## Integration Test Summary" > test-summary.md

.github/workflows/security.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,23 @@ jobs:
3232
echo "🔍 Scanning for hardcoded secrets..."
3333
3434
# Check for potential API keys
35-
if grep -r "nutr_sk_" --include="*.py" --include="*.json" --include="*.yml" --include="*.yaml" --exclude-dir=.venv --exclude-dir=__pycache__ --exclude-dir=.pytest_cache . 2>/dev/null; then
35+
if grep -r "pdf_live_" --include="*.py" --include="*.json" --exclude-dir=.venv --exclude-dir=__pycache__ --exclude-dir=.pytest_cache . 2>/dev/null; then
3636
echo "❌ Found hardcoded API keys!"
3737
exit 1
3838
fi
3939
4040
# Check for base64 encoded secrets (common Nutrient patterns)
41-
if grep -r "bnV0cl9za18" --include="*.py" --include="*.json" --include="*.yml" --include="*.yaml" --exclude-dir=.venv --exclude-dir=__pycache__ --exclude-dir=.pytest_cache . 2>/dev/null; then
41+
if grep -r "cGRmX2xpdmVf" --include="*.py" --include="*.json" --exclude-dir=.venv --exclude-dir=__pycache__ --exclude-dir=.pytest_cache . 2>/dev/null; then
4242
echo "❌ Found base64 encoded API keys!"
4343
exit 1
4444
fi
4545
4646
# Check for other common secret patterns
47-
if grep -rE "(sk_|pk_|nutr_sk_)" --include="*.py" --include="*.json" --include="*.yml" --include="*.yaml" --exclude-dir=.venv --exclude-dir=__pycache__ --exclude-dir=.pytest_cache . 2>/dev/null; then
47+
if grep -rE "(sk_|pk_|nutr_sk_)" --include="*.py" --include="*.json" --exclude-dir=.venv --exclude-dir=__pycache__ --exclude-dir=.pytest_cache . 2>/dev/null; then
4848
echo "❌ Found potential secret keys!"
4949
exit 1
5050
fi
5151
52-
# Check for AWS/cloud secrets
53-
if grep -rE "(AKIA[0-9A-Z]{16}|aws_access_key_id|aws_secret_access_key)" --include="*.py" --include="*.json" --include="*.yml" --include="*.yaml" --exclude-dir=.venv --exclude-dir=__pycache__ --exclude-dir=.pytest_cache . 2>/dev/null; then
54-
echo "❌ Found potential AWS secrets!"
55-
exit 1
56-
fi
57-
5852
echo "✅ No hardcoded secrets found"
5953
6054
dependency-check:
@@ -68,12 +62,10 @@ jobs:
6862
with:
6963
python-version: '3.12'
7064
cache: 'pip'
71-
cache-dependency-path: 'pyproject.toml'
7265

7366
- name: Install dependencies
7467
run: |
75-
python -m pip install --upgrade pip
76-
pip install -e ".[dev]"
68+
pip install ".[dev]"
7769
pip install safety bandit
7870
7971
- name: Run Safety check
@@ -124,12 +116,10 @@ jobs:
124116
with:
125117
python-version: '3.12'
126118
cache: 'pip'
127-
cache-dependency-path: 'pyproject.toml'
128119

129120
- name: Install dependencies
130121
run: |
131-
python -m pip install --upgrade pip
132-
pip install -e ".[dev]"
122+
pip install ".[dev]"
133123
134124
- name: Run additional security checks with ruff
135125
run: |

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,5 +154,5 @@ openapi_spec.yml
154154
.pixi
155155
.claude/settings.local.json
156156

157-
# Integration test configuration
158-
tests/integration/integration_config.py
157+
# Environment file
158+
.env

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ python -m pytest --cov=nutrient_dws --cov-report=html
202202
python -m pytest tests/unit/
203203

204204
# Run integration tests (requires API key)
205-
NUTRIENT_API_KEY=your_key python -m pytest tests/integration/
205+
NUTRIENT_API_KEY=your_key python -m pytest tests/integration.py
206206
```
207207

208208
The library maintains high test coverage across all API methods, including:

0 commit comments

Comments
 (0)