-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (130 loc) Β· 4.47 KB
/
test.yml
File metadata and controls
158 lines (130 loc) Β· 4.47 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
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
# Stage 1: Lint first (fastest check)
lint:
name: "Lint Code"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install linting tools
run: |
python -m pip install --upgrade pip
pip install flake8 pylint
- name: Lint with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 dtor --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings
flake8 dtor --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
continue-on-error: true
# Stage 2: Test on Linux (most common platform)
test-linux:
name: "π§ Linux - Python ${{ matrix.python-version }}"
runs-on: ubuntu-latest
needs: lint
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
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 system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libevent-2.1-7 libssl3 zlib1g
- name: Upgrade pip
run: python -m pip install --upgrade pip setuptools wheel
- name: Install Python dependencies
run: |
pip install -r requirements.txt
pip install -e .
- name: Run tests
run: |
python test.py
- name: Verify package import
run: |
python -c "import dtor; print('dtor version:', dtor.__version__ if hasattr(dtor, '__version__') else 'unknown')"
# Stage 3: Test on Windows (after Linux passes)
test-windows:
name: "πͺ Windows - Python ${{ matrix.python-version }}"
runs-on: windows-latest
needs: test-linux
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip setuptools wheel
- name: Install Python dependencies
run: |
pip install -r requirements.txt
pip install -e .
- name: Run tests
run: |
python test.py
- name: Verify package import
run: |
python -c "import dtor; print('dtor version:', dtor.__version__ if hasattr(dtor, '__version__') else 'unknown')"
# Stage 4: Test on macOS (after Windows passes)
test-macos:
name: "π macOS - Python ${{ matrix.python-version }}"
runs-on: macos-latest
needs: test-windows
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip setuptools wheel
- name: Install Python dependencies
run: |
pip install -r requirements.txt
pip install -e .
- name: Run tests
run: |
python test.py
- name: Verify package import
run: |
python -c "import dtor; print('dtor version:', dtor.__version__ if hasattr(dtor, '__version__') else 'unknown')"
# Stage 5: Final summary
test-complete:
name: "β
All Tests Passed"
runs-on: ubuntu-latest
needs: [test-linux, test-windows, test-macos]
steps:
- name: Success
run: |
echo "=========================================="
echo "β
All platform tests completed successfully!"
echo "=========================================="
echo "Tested platforms:"
echo " π§ Linux (Ubuntu) - Python 3.8, 3.9, 3.10, 3.11, 3.12"
echo " πͺ Windows - Python 3.8, 3.9, 3.10, 3.11, 3.12"
echo " π macOS - Python 3.8, 3.9, 3.10, 3.11, 3.12"
echo "=========================================="