-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (96 loc) · 3.42 KB
/
Copy pathci.yml
File metadata and controls
113 lines (96 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: CI
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
jobs:
test:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dependencies
uses: actions/cache@v6
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
echo "Installing test requirements..."
pip install -r requirements-test.txt
echo "Installing package..."
pip install -e .
echo "Verifying key dependencies:"
python -c "import elasticsearch; print('✓ elasticsearch')" || echo "✗ elasticsearch missing"
python -c "import slack_sdk; print('✓ slack_sdk')" || echo "✗ slack_sdk missing"
python -c "import pymysql; print('✓ pymysql')" || echo "✗ pymysql missing"
- name: Auto-format with black
run: |
black nui_shared_utils tests
if ! git diff --quiet; then
echo "::warning::Code was auto-formatted by Black"
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "Auto-format code with Black [skip ci]" || echo "No changes to commit"
else
echo "✅ Code is already properly formatted"
fi
- name: Type check with mypy
run: |
mypy nui_shared_utils --ignore-missing-imports
continue-on-error: true # Don't fail CI on type errors yet
- name: Test with pytest
run: |
pytest --cov=nui_shared_utils --cov-report=xml --cov-report=term-missing -v
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
build:
name: Build Package
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Check package integrity
run: |
twine check dist/*
echo "Package contents:"
python -m tarfile -l dist/*.tar.gz | head -20
echo "Wheel contents:"
python -m zipfile -l dist/*.whl | head -20
- name: Test installation
run: |
pip install dist/*.whl
python -c "import nui_shared_utils; print('✅ Package imports successfully')"
python -c "from nui_shared_utils import Config, get_secret; print('✅ Core imports work')"
python -W ignore::DeprecationWarning -c "import nui_lambda_shared_utils; print('✅ Backwards-compat shim works')"