-
Notifications
You must be signed in to change notification settings - Fork 12
119 lines (96 loc) · 3.84 KB
/
develop.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
name: Verify that tests pass on all platforms
on: [push]
jobs:
lint_code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
rm -rf 0/
flake8 cyanure --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 cyanure --count --max-complexity=10 --max-line-length=110 --statistics
build_wheels:
needs: [lint_code]
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: 3.8
if: runner.os == 'macOS' && runner.arch == 'ARM64'
- uses: conda-incubator/setup-miniconda@v3
if: runner.os == 'macOS'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.19.2
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
- name: To avoid clean up error
run: sudo rm -rf "/Users/runner/conda_pkgs_dir"
if: runner.os == 'macOS' && runner.arch == 'ARM64'
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
test_imports:
needs: [build_wheels]
name: Smoke test for c++ depenencies on raw ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10']
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Try to import cyanure
run: pip install "scipy<=1.8.1" && pip install "numpy<=1.23.5" && pip install "scikit-learn>=1.1.3" && python -m pip install --no-index --find-links dist cyanure && python -c "import cyanure;"
run_tests:
needs: [build_wheels]
name: Run the tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10']
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install cyanure
run: pip install "scipy<=1.8.1" && pip install "numpy<=1.23.5" && pip install "scikit-learn>=1.1.3" && python -m pip install --no-index --find-links dist cyanure
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Switch to Current Branch
run: git checkout ${{ env.BRANCH }}
- name: Run tests without the lib
uses: knicknic/[email protected]
with:
macos: rm -rf cyanure && rm -rf cyanure_lib && python -m pip install pytest && python -m pip install pandas && python -m pip install libsvmdata && pip list && python -m pytest test/
linux: rm -rf cyanure && rm -rf cyanure_lib && python -m pip install pytest && python -m pip install pandas && python -m pip install libsvmdata && pip list && python -m pytest test/
windows: Remove-Item -Force -Recurse cyanure && Remove-Item -Force -Recurse cyanure_lib && python -m pip install pytest && python -m pip install libsvmdata && python -m pip install pandas && python -m pytest test/