Skip to content

Commit 6711875

Browse files
committed
Refine CI install and test checks
1 parent 2b6bd72 commit 6711875

3 files changed

Lines changed: 19 additions & 8 deletions

File tree

.github/workflows/pr_code_check.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ name: PR code review
33
on:
44
workflow_dispatch:
55
pull_request:
6+
branches:
7+
- pybind11
68
push:
79
branches:
8-
- master
10+
- pybind11
911

1012
concurrency:
1113
group: ${{ github.workflow }}-${{ github.ref }}
@@ -44,6 +46,5 @@ jobs:
4446
- name: Build and install
4547
run: pip install --verbose .
4648

47-
- name: Test
48-
run: python tests/test.py
49-
49+
- name: Smoke test
50+
run: python -c "import os, tempfile; os.chdir(tempfile.gettempdir()); import easygraph as eg; G = eg.Graph(); G.add_edge(1, 2); assert G.number_of_nodes() == 2; assert G.number_of_edges() == 1"

.github/workflows/test.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: Test the package with pytest
22

3-
on: [push, pull_request, workflow_dispatch]
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- pybind11
8+
push:
9+
branches:
10+
- pybind11
411

512
jobs:
613
pytest:
@@ -12,12 +19,12 @@ jobs:
1219
# ubuntu 22.04 has deprecated python 3.6
1320
python-version: [ "3.8", "3.9", "3.10","3.11", "3.12"]
1421
steps:
15-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
1623
with:
1724
submodules: recursive
1825

1926
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v4
27+
uses: actions/setup-python@v5
2128
with:
2229
python-version: ${{ matrix.python-version }}
2330

@@ -36,4 +43,4 @@ jobs:
3643
3744
- name: Test with pytest
3845
run: |
39-
pytest --disable-warnings --ignore=cpp_easygraph
46+
pytest easygraph --disable-warnings

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ def build_extension(self, ext: CMakeExtension) -> None:
4747
cmake_args = [
4848
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}{os.sep}",
4949
f"-DPYTHON_EXECUTABLE={sys.executable}",
50+
f"-DPython_EXECUTABLE={sys.executable}",
51+
f"-DPython3_EXECUTABLE={sys.executable}",
52+
"-DPYBIND11_FINDPYTHON=ON",
5053
f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm
5154
f"-DEASYGRAPH_ENABLE_GPU={'ON' if enable_gpu else 'OFF'}",
5255
]

0 commit comments

Comments
 (0)