-
-
Notifications
You must be signed in to change notification settings - Fork 3
89 lines (78 loc) · 3.08 KB
/
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
name: Tests
on: [push, pull_request]
jobs:
tests:
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
os: [ubuntu-20.04, macos-12, windows-2019]
cython: [false, true]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.8.4
- name: Install Dependencies (Pure Python)
if: ${{ !matrix.cython }}
run: |
poetry install --without dev,docs
poetry run python -c "import sys; print('Python version:', sys.version)"
poetry run python -c "import iscc_core; print('iscc_core version:', iscc_core.__version__)"
- name: Install Dependencies (with Cython)
if: ${{ matrix.cython }}
run: |
poetry install --without dev,docs --extras cython
poetry run python -c "import sys; print('Python version:', sys.version)"
poetry run python -c "import iscc_core; print('iscc_core version:', iscc_core.__version__)"
poetry run python -c "import iscc_core; print('Using Cython:', iscc_core.USING_CYTHON)"
poetry run python -c "import iscc_core; print('iscc_core file:', iscc_core.__file__)"
poetry run python -c "import iscc_core.cdc; print('cdc module:', iscc_core.cdc.__file__)"
- name: Run Tests
run: |
poetry run python -c "import iscc_core; print(f'Using Cython: {iscc_core.USING_CYTHON}')"
poetry run pytest -v tests
- name: Debug Info
if: failure()
run: |
echo "Current directory:"
pwd
echo "Directory contents:"
ls -R
echo "Python version:"
python --version
echo "Pip list:"
pip list
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: matrix.os == 'ubuntu-20.04' && matrix.python-version == '3.9' && !matrix.cython
- name: Build Wheel
if: ${{ matrix.cython }}
run: poetry build -f wheel
- name: Test Wheel Installation
if: ${{ matrix.cython && runner.os != 'Windows' }}
run: |
python -m venv venv
source venv/bin/activate
pip install dist/*.whl
python -c "import iscc_core; iscc_core.conformance_selftest()"
python -c "import iscc_core; print(iscc_core.turbo())"
- name: Test Wheel Installation on Windows
if: ${{ matrix.cython && runner.os == 'Windows' }}
run: |
python -m venv venv
venv\Scripts\Activate.ps1
$wheelFile = (Get-ChildItem dist/*.whl -Name)
pip install "dist/$wheelFile"
python -c "import iscc_core; iscc_core.conformance_selftest()"
python -c "import iscc_core; print(iscc_core.turbo())"
- name: Collect Wheel
if: ${{ matrix.cython }}
uses: actions/upload-artifact@v3
with:
path: dist/*.whl