-
-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (129 loc) · 5.05 KB
/
Copy pathtest-bindings.yml
File metadata and controls
145 lines (129 loc) · 5.05 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Test Python & Django Packages
on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master, develop]
env:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
jobs:
# Test Python package
test-python:
name: 🐍 Test Python (${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install maturin
run: pip install maturin pytest
- name: Build and install Python package
shell: bash
run: |
cd bindings/python
maturin build --out dist
pip install dist/*.whl
- name: Run tests
run: |
cd bindings/python
pytest test_npdatetime.py -v
continue-on-error: true
# Test Django package
test-django:
name: 🎯 Django (Py${{ matrix.python-version }}, Django${{ matrix.django-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
django-version: ["3.2", "4.2", "5.0", "5.1", "5.2", "6.0", "6.0.2"]
exclude:
# Django 5.x requires Python 3.10+
- python-version: "3.8"
django-version: "5.0"
- python-version: "3.8"
django-version: "5.1"
- python-version: "3.8"
django-version: "5.2"
- python-version: "3.9"
django-version: "5.0"
- python-version: "3.9"
django-version: "5.1"
- python-version: "3.9"
django-version: "5.2"
# Django 6.x requires Python 3.12+
- python-version: "3.8"
django-version: "6.0"
- python-version: "3.8"
django-version: "6.0.2"
- python-version: "3.9"
django-version: "6.0"
- python-version: "3.9"
django-version: "6.0.2"
- python-version: "3.10"
django-version: "6.0"
- python-version: "3.10"
django-version: "6.0.2"
- python-version: "3.11"
django-version: "6.0"
- python-version: "3.11"
django-version: "6.0.2"
# Django 3.2 doesn't support Python 3.11+
- python-version: "3.11"
django-version: "3.2"
- python-version: "3.12"
django-version: "3.2"
- python-version: "3.13"
django-version: "3.2"
- python-version: "3.14"
django-version: "3.2"
# Django 4.2 doesn't support Python 3.14 (experimental/prerelease)
- python-version: "3.14"
django-version: "4.2"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Rust and build WASM
uses: dtolnay/rust-toolchain@stable
- name: Install wasm-pack and maturin
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
pip install maturin
- name: Build WASM bindings
run: |
cd bindings/javascript
wasm-pack build --target web
- name: Sync assets to Django
run: |
cd bindings/django
python3 build_assets.py || python build_assets.py
- name: Install Django and package
shell: bash
run: |
pip install Django==${{ matrix.django-version }}
# Build and install core npdatetime from local source
cd bindings/python
maturin build --out dist
pip install dist/*.whl
cd ../..
# Install django package
cd bindings/django
pip install .
- name: Run Django checks
run: |
cd bindings/django
python -c "import npdatetime_django; print('✓ Package imported successfully')"
python -c "from npdatetime_django import NepaliDateField; print('✓ Model fields imported')"
python -c "from npdatetime_django.widgets import NepaliDatePickerWidget; print('✓ Widgets imported')"
python -c "from npdatetime_django.templatetags import nepali_date; print('✓ Template tags imported')"