1+ name : Tests
2+ concurrency :
3+ group : ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
4+ cancel-in-progress : true
5+
6+ on :
7+ push :
8+ branches :
9+ - main
10+ pull_request :
11+ branches :
12+ - main
13+ workflow_dispatch :
14+
15+ jobs :
16+ build_sdist :
17+ name : Build sdist
18+ runs-on : ubuntu-20.04
19+ outputs :
20+ SDIST_NAME : ${{ steps.sdist.outputs.SDIST_NAME }}
21+ steps :
22+ - uses : actions/checkout@v3
23+ with :
24+ fetch-depth : 0
25+
26+ - uses : actions/setup-python@v4
27+ name : Install python
28+ with :
29+ python-version : 3.9
30+ cache : ' pip'
31+
32+ - name : Install dependencies
33+ run : |
34+ python -m pip install --upgrade pip
35+ pip install -r requirements.txt
36+ pip install twine flake8
37+
38+ - name : Lint with flake8
39+ run : |
40+ # stop the build if there are Python syntax errors or undefined names
41+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
42+
43+ - name : Build sdist
44+ id : sdist
45+ run : |
46+ python setup.py sdist
47+ python ci/export_sdist_name.py
48+
49+ - name : Check README rendering for PyPI
50+ run : twine check dist/*
51+
52+ - name : Upload sdist result
53+ uses : actions/upload-artifact@v3
54+ with :
55+ name : sdist
56+ path : dist/*.tar.gz
57+ if-no-files-found : error
58+
59+ build_wheels :
60+ name : Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }}
61+ needs : build_sdist
62+ runs-on : ${{ matrix.os }}
63+ strategy :
64+ fail-fast : false
65+ matrix :
66+ include :
67+ - os : windows-latest
68+ python : 39
69+ platform_id : win_amd64
70+ - os : windows-latest
71+ python : 310
72+ platform_id : win_amd64
73+ - os : windows-latest
74+ python : 311
75+ platform_id : win_amd64
76+
77+ # Linux 64 bit manylinux2014
78+ - os : ubuntu-latest
79+ python : 39
80+ platform_id : manylinux_x86_64
81+ manylinux_image : manylinux2014
82+ - os : ubuntu-latest
83+ python : 310
84+ platform_id : manylinux_x86_64
85+ manylinux_image : manylinux2014
86+ - os : ubuntu-latest
87+ python : 311
88+ platform_id : manylinux_x86_64
89+ manylinux_image : manylinux2014
90+
91+ # MacOS x86_64
92+ - os : macos-latest
93+ python : 39
94+ platform_id : macosx_x86_64
95+ - os : macos-latest
96+ python : 310
97+ platform_id : macosx_x86_64
98+ - os : macos-latest
99+ python : 311
100+ platform_id : macosx_x86_64
101+ steps :
102+ - name : Download sdist
103+ uses : actions/download-artifact@v3
104+ with :
105+ name : sdist
106+ path : dist/
107+
108+ - name : Setup Python
109+ uses : actions/setup-python@v4
110+ with :
111+ python-version : ' 3.9' # update once build dependencies are available
112+
113+ - name : Build and Test wheels
114+ uses : pypa/cibuildwheel@51f5c7fe68ff24694d5a6ac0eb3ad476ddd062a8 # v2.13.0
115+ with :
116+ package-dir : dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
117+ env :
118+ CIBW_BUILD : cp${{ matrix.python }}-${{ matrix.platform_id }}
119+ CIBW_ARCHS : all
120+ CIBW_MANYLINUX_X86_64_IMAGE : ${{ matrix.manylinux_image }}
121+ CIBW_MANYLINUX_I686_IMAGE : ${{ matrix.manylinux_image }}
122+ CIBW_TEST_REQUIRES : pytest matplotlib pandas networkx
123+ CIBW_TEST_COMMAND : pytest {package}/tests
124+ CIBW_BUILD_VERBOSITY : 1
125+
126+ - name : Store artifacts
127+ uses : actions/upload-artifact@v3
128+ with :
129+ name : wheels
130+ path : wheelhouse/*.whl
131+ if-no-files-found : ignore
132+
133+
0 commit comments