-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (141 loc) · 5.46 KB
/
run-tests.yml
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
159
160
161
162
163
164
165
166
name: run-tests
on:
push:
jobs:
run-macos-tests:
name: Runs tests on ${{ matrix.os }}-cp${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
- name: Compile aten
run: |
CMAKE_DEV=1 pip install . -vvv
- name: Run CPP tests
run: |
./build/test/tests
- name: Run Python tests
run: |
python test/GradTensor/algebra_test.py
python test/GradTensor/constructor_test.py
python test/GradTensor/util_test.py
python test/Tensor/algebra_test.py
python test/Tensor/constructor_test.py
python test/Tensor/util_test.py
run-win-tests:
name: Runs tests on ${{ matrix.os }}-cp${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install "pybind11[global]"
- name: Compile aten
shell: pwsh
run: |
$env:CMAKE_DEV = 1
pip install . -vvv
# Debug: Check installation
Write-Host "Python path:"
python -c "import sys; print('\n'.join(sys.path))"
# Get exact Python version
$pythonVersion = python -c "import sys; print(sys.version.split()[0])"
Write-Host "Exact Python version: $pythonVersion"
Write-Host "Installed files:"
Get-ChildItem -Recurse "C:\hostedtoolcache\windows\Python\$pythonVersion\x64\Lib\site-packages\ember"
Write-Host "Checking installed package:"
pip list | findstr "pyember"
Write-Host "Attempting import:"
python -c "from ember import aten; print('aten module contents:', dir(aten))"
- name: Find and Run CPP tests
shell: pwsh
run: |
$testPaths = @(
".\build\test\Debug\tests.exe",
".\build\test\Release\tests.exe",
".\build\test\tests.exe"
)
$testPath = $null
foreach ($path in $testPaths) {
if (Test-Path $path) {
$testPath = $path
break
}
}
if ($testPath) {
Write-Host "Found test executable at: $testPath"
& $testPath
} else {
Write-Host "Test executable not found. Directory contents:"
Get-ChildItem -Recurse .\build\test
exit 1
}
- name: Run Python tests
shell: pwsh
run: |
$env:PYTHONPATH = "."
python test/GradTensor/algebra_test.py
python test/GradTensor/constructor_test.py
python test/GradTensor/util_test.py
python test/Tensor/algebra_test.py
python test/Tensor/constructor_test.py
python test/Tensor/util_test.py
run-manylinux-tests:
name: Runs tests on manylinux_2_28_x86_64-cp${{ matrix.python }}
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.11"] # development python not supported
steps:
- uses: actions/checkout@v4
- name: Run tests in manylinux container
uses: addnab/docker-run-action@v3
with:
image: quay.io/pypa/manylinux_2_28_x86_64
options: -v ${{ github.workspace }}:/pyember
run: |
# Install development version of python
yum install -y python3-devel
yum install -y epel-release
yum install -y python3.11-devel
# Set python paths
PYTHON_VERSION=$(echo "${{ matrix.python }}" | tr -d '.')
PYSHORT="${{ matrix.python }}"
export PYROOT="/opt/python/cp${PYTHON_VERSION}-cp${PYTHON_VERSION}"
export PATH="${PYROOT}/bin:$PATH"
${PYROOT}/bin/python -m pip install --upgrade pip
export PYTHON_EXECUTABLE="${PYROOT}/bin/python"
export PYTHON_INCLUDE_DIR="${PYROOT}/include/python${PYSHORT}"
export Python_ROOT_DIR="${PYROOT}"
${PYROOT}/bin/pip install "pybind11[global]"
cd /pyember
CMAKE_DEV=1 ${PYROOT}/bin/pip install -e . -vv
${PYROOT}/bin/python -c "import ember; print(ember.__file__)"
# Run CPP tests (must be put in here to keep environ variables)
./build/test/tests
# Run Python Tests
${PYROOT}/bin/python test/GradTensor/algebra_test.py
${PYROOT}/bin/python test/GradTensor/constructor_test.py
${PYROOT}/bin/python test/GradTensor/util_test.py
${PYROOT}/bin/python test/Tensor/algebra_test.py
${PYROOT}/bin/python test/Tensor/constructor_test.py
${PYROOT}/bin/python test/Tensor/util_test.py