Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/pr_code_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ name: PR code review
on:
workflow_dispatch:
pull_request:
branches:
- pybind11
push:
branches:
- master
- pybind11

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -44,6 +46,5 @@ jobs:
- name: Build and install
run: pip install --verbose .

- name: Test
run: python tests/test.py

- name: Smoke test
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"
31 changes: 26 additions & 5 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
name: pre-commit

on:
workflow_dispatch:
pull_request:
branches:
- pybind11
push:
branches:
- pybind11

jobs:
pre-commit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
with:
python-version: '3.10'
- uses: pre-commit/action@v3.0.0
fetch-depth: 0

- uses: actions/setup-python@v5
with:
extra_args: "--all-files"
python-version: '3.10'

- name: Install pre-commit
run: python -m pip install pre-commit

- name: Run pre-commit on changed files
shell: bash
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
base_ref="${{ github.event.pull_request.base.sha }}"
elif [[ -n "${{ github.event.before }}" && ! "${{ github.event.before }}" =~ ^0+$ ]]; then
base_ref="${{ github.event.before }}"
else
base_ref="$(git rev-parse HEAD~1)"
fi

pre-commit run --show-diff-on-failure --color=always --from-ref "$base_ref" --to-ref "${{ github.sha }}"
15 changes: 11 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Test the package with pytest

on: [push, pull_request, workflow_dispatch]
on:
workflow_dispatch:
pull_request:
branches:
- pybind11
push:
branches:
- pybind11

jobs:
pytest:
Expand All @@ -12,12 +19,12 @@ jobs:
# ubuntu 22.04 has deprecated python 3.6
python-version: [ "3.8", "3.9", "3.10","3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -36,4 +43,4 @@ jobs:

- name: Test with pytest
run: |
pytest --disable-warnings --ignore=cpp_easygraph
pytest easygraph --disable-warnings
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def build_extension(self, ext: CMakeExtension) -> None:
cmake_args = [
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}{os.sep}",
f"-DPYTHON_EXECUTABLE={sys.executable}",
f"-DPython_EXECUTABLE={sys.executable}",
f"-DPython3_EXECUTABLE={sys.executable}",
"-DPYBIND11_FINDPYTHON=ON",
f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm
f"-DEASYGRAPH_ENABLE_GPU={'ON' if enable_gpu else 'OFF'}",
]
Expand Down
Loading