Skip to content

Commit 4c843a3

Browse files
ci: update ci pipelines (#145)
1 parent 3066680 commit 4c843a3

13 files changed

Lines changed: 200 additions & 64 deletions

.github/workflows/build-docker-image.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,27 @@ jobs:
2424
rm -rf /usr/local/android /usr/share/dotnet /usr/local/share/boost /opt/ghc
2525
docker system prune --all --volumes --force
2626
- name: Checkout out repository
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@v6
2828
with:
2929
fetch-depth: 0
3030
- name: Get latest package version
3131
shell: bash
3232
run: |
3333
latest_version=$(git tag -l 'v[0-9]*\.[0-9]*\.[0-9]*' | sort | tail -1)
3434
echo "latest_version=${latest_version:1}" >> $GITHUB_ENV
35-
- name: Build and push a docker image with pointtree installation (version tag)
36-
uses: elgohr/Publish-Docker-Github-Action@v5
35+
- name: Log in to Docker Hub
36+
uses: docker/login-action@v3
3737
with:
38-
name: josafatburmeister/pointtree:${{ env.latest_version }}-torch2.4.0-cuda12.4
3938
username: ${{ secrets.DOCKER_HUB_USER }}
4039
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
41-
dockerfile: Dockerfile
42-
context: .
43-
- name: Build and push a docker image with pointtree installation (latest tag)
44-
uses: elgohr/Publish-Docker-Github-Action@v5
40+
- name: Build and push Docker image
41+
uses: docker/build-push-action@v6
4542
with:
46-
name: josafatburmeister/pointtree:latest
47-
username: ${{ secrets.DOCKER_HUB_USER }}
48-
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
49-
dockerfile: Dockerfile
5043
context: .
44+
file: Dockerfile
45+
push: true
46+
tags: |
47+
josafatburmeister/pointtree:${{ env.latest_version }}-torch2.10.0-cuda12.9
48+
josafatburmeister/pointtree:latest
5149
- name: Clean up docker build remains
5250
run: docker system prune --all --volumes --force

.github/workflows/code-quality-main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ on:
77
jobs:
88
ci:
99
uses: ./.github/workflows/code-quality.yml
10-
secrets:
11-
codecov_token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/code-quality-pull-requests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@ on:
99
jobs:
1010
ci:
1111
uses: ./.github/workflows/code-quality.yml
12-
secrets:
13-
codecov_token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/code-quality.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ name: Code Quality Checks
22

33
on:
44
workflow_call:
5-
secrets:
6-
codecov_token:
7-
required: true
5+
6+
permissions:
7+
contents: read
8+
id-token: write
89

910
jobs:
1011
black:
@@ -13,9 +14,9 @@ jobs:
1314
- name: Clean up potential remnants of past jobs
1415
uses: AutoModality/action-clean@v1.1.0
1516
- name: Checkout out repository
16-
uses: actions/checkout@v4
17+
uses: actions/checkout@v6
1718
- name: Setup up Python
18-
uses: actions/setup-python@v3
19+
uses: actions/setup-python@v6
1920
with:
2021
python-version: '3.12'
2122
- name: Analysing the code with black
@@ -30,7 +31,7 @@ jobs:
3031
- name: Clean up potential remnants of past jobs
3132
uses: AutoModality/action-clean@v1.1.0
3233
- name: Checkout out repository
33-
uses: actions/checkout@v4
34+
uses: actions/checkout@v6
3435
- name: Format C++ code with clang-format
3536
shell: bash
3637
run: |
@@ -46,7 +47,7 @@ jobs:
4647
- name: Clean up potential remnants of past jobs
4748
uses: AutoModality/action-clean@v1.1.0
4849
- name: Checkout out repository
49-
uses: actions/checkout@v4
50+
uses: actions/checkout@v6
5051
- name: Analysing the code with mypy
5152
shell: bash
5253
run: |
@@ -67,7 +68,7 @@ jobs:
6768
- name: Clean up potential remnants of past jobs
6869
uses: AutoModality/action-clean@v1.1.0
6970
- name: Checkout out repository
70-
uses: actions/checkout@v4
71+
uses: actions/checkout@v6
7172
- name: Analysing the code with pylint
7273
shell: bash
7374
run: |
@@ -97,7 +98,7 @@ jobs:
9798
- name: Clean up potential remnants of past jobs
9899
uses: AutoModality/action-clean@v1.1.0
99100
- name: Checkout out repository
100-
uses: actions/checkout@v4
101+
uses: actions/checkout@v6
101102
with:
102103
ref: ${{ github.head_ref }}
103104
fetch-depth: 0
@@ -134,8 +135,8 @@ jobs:
134135
NUMBA_DISABLE_JIT=1 pytest --cov --cov-report=xml
135136
- name: Upload results to Codecov
136137
if: matrix.version.python == '3.14'
137-
uses: codecov/codecov-action@v4
138+
uses: codecov/codecov-action@v5
138139
with:
139140
fail_ci_if_error: true
140-
token: ${{ secrets.codecov_token }}
141+
use_oidc: true
141142
verbose: true

.github/workflows/conventional-commits-pull-requests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: PR Conventional Commit Validation
14-
uses: ytanikin/pr-conventional-commits@1.1.0
14+
uses: ytanikin/pr-conventional-commits@1.4.2
1515
with:
1616
task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert"]'
1717
add_label: 'true'

.github/workflows/deploy-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ concurrency:
3131

3232
jobs:
3333
deploy-docs:
34-
if: github.repository == 'ai4trees/pointtree'
34+
if: github.repository == 'ai4trees/pointtree' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
3535
runs-on: ubuntu-latest
3636
environment:
3737
name: github-pages
@@ -45,7 +45,7 @@ jobs:
4545
- name: Clean up potential remnants of past jobs
4646
uses: AutoModality/action-clean@v1.1.0
4747
- name: Checkout out repository
48-
uses: actions/checkout@v4
48+
uses: actions/checkout@v6
4949
with:
5050
fetch-depth: 0
5151
- name: Prepare docs build
@@ -113,7 +113,7 @@ jobs:
113113
- name: Setup Pages
114114
uses: actions/configure-pages@v5
115115
- name: Upload artifact
116-
uses: actions/upload-pages-artifact@v3
116+
uses: actions/upload-pages-artifact@v4
117117
with:
118118
# Upload entire repository
119119
path: './docs/all_builds'

.github/workflows/generate-docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ concurrency:
1515

1616
jobs:
1717
generate-docs:
18+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
1819
runs-on: ubuntu-latest
1920
container:
2021
image: josafatburmeister/pointtree:latest
@@ -24,7 +25,7 @@ jobs:
2425
- name: Clean up potential remnants of past jobs
2526
uses: AutoModality/action-clean@v1.1.0
2627
- name: Checkout out repository
27-
uses: actions/checkout@v4
28+
uses: actions/checkout@v6
2829
with:
2930
ref: ${{ github.head_ref }}
3031
fetch-depth: 0

.github/workflows/release-package.yml

Lines changed: 131 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,127 @@ concurrency:
1414
cancel-in-progress: false
1515

1616
jobs:
17+
build-wheels:
18+
name: Build wheels for ${{ matrix.os }}
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
matrix:
22+
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]
23+
steps:
24+
# Note: we need to checkout the repository at the workflow sha in case during the workflow
25+
# the branch was updated. To keep PSR working with the configured release branches,
26+
# we force a checkout of the desired release branch but at the workflow sha HEAD.
27+
- name: Check out repository at workflow sha
28+
uses: actions/checkout@v6
29+
with:
30+
fetch-depth: 0
31+
ref: ${{ github.sha }}
32+
- name: Force correct release branch on workflow sha
33+
run: git checkout -B ${{ github.ref_name }} ${{ github.sha }}
34+
# to build the package, a preview of the released version is created but not committed
35+
- name: Create release preview
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install build wheel python-semantic-release
39+
semantic-release version --no-commit --skip-build --no-vcs-release --no-tag
40+
- name: Install OpenMP on MacOS
41+
if: ${{ startsWith(matrix.os, 'macos') }}
42+
run: |
43+
git clone --depth 1 https://github.com/llvm/llvm-project.git
44+
45+
cmake -S llvm-project/runtimes -B llvm-project/build-openmp \
46+
-DLLVM_ENABLE_RUNTIMES=openmp \
47+
-DCMAKE_BUILD_TYPE=Release \
48+
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/llvm-project/openmp/install" \
49+
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
50+
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
51+
-DLIBOMP_ENABLE_SHARED=ON
52+
53+
cmake --build llvm-project/build-openmp -j
54+
cmake --install llvm-project/build-openmp
55+
- name: Build wheels
56+
uses: pypa/cibuildwheel@v3.3.0
57+
env:
58+
CIBW_SKIP: "*-win32 cp314t-* *-musllinux_*"
59+
CIBW_CONFIG_SETTINGS_MACOS: >
60+
cmake.args=-DOPENMP_ROOT=${{ github.workspace }}/llvm-project/openmp/install
61+
CIBW_ENVIRONMENT_MACOS: >
62+
MACOSX_DEPLOYMENT_TARGET=10.15
63+
DYLD_LIBRARY_PATH="${{ github.workspace }}/llvm-project/openmp/install/lib"
64+
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
65+
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"
66+
CIBW_TEST_COMMAND: pytest {package}/test
67+
CIBW_TEST_REQUIRES: pytest
68+
CIBW_BEFORE_TEST_LINUX: >
69+
ARCH=$(python -c "import platform; print(platform.machine())") &&
70+
if [ "$ARCH" = "aarch64" ]; then
71+
python -m pip install --upgrade pip setuptools wheel ninja build meson-python &&
72+
python -m pip install torch==2.10.0 &&
73+
python -m pip install --no-build-isolation --no-binary=torch-scatter torch-scatter -f https://data.pyg.org/whl/torch-2.10.0+cpu.html &&
74+
python -m pip install --no-build-isolation --no-binary=torch-cluster torch-cluster -f https://data.pyg.org/whl/torch-2.10.0+cpu.html;
75+
else
76+
python -m pip install --upgrade pip setuptools wheel build;
77+
python -m pip install torch==2.10.0 &&
78+
python -m pip install --no-build-isolation --no-binary=torch-scatter torch-scatter -f https://data.pyg.org/whl/torch-2.10.0+cpu.html &&
79+
python -m pip install --no-build-isolation --no-binary=torch-cluster torch-cluster -f https://data.pyg.org/whl/torch-2.10.0+cpu.html;
80+
fi
81+
CIBW_BEFORE_TEST_MACOS: >
82+
python -m pip install --upgrade pip "setuptools<81" &&
83+
python -m pip install torch==2.10.0 &&
84+
python -m pip install --no-build-isolation torch-scatter -f https://data.pyg.org/whl/torch-2.10.0+cpu.html &&
85+
python -m pip install --no-build-isolation torch-cluster -f https://data.pyg.org/whl/torch-2.10.0+cpu.html
86+
CIBW_BEFORE_TEST_WINDOWS: >
87+
python -m pip install --upgrade pip &&
88+
python -m pip install torch==2.10.0 &&
89+
python -m pip install --no-build-isolation torch-scatter -f https://data.pyg.org/whl/torch-2.10.0+cpu.html &&
90+
python -m pip install --no-build-isolation torch-cluster -f https://data.pyg.org/whl/torch-2.10.0+cpu.html
91+
- uses: actions/upload-artifact@v6
92+
with:
93+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
94+
path: ./wheelhouse/*.whl
95+
96+
build-sdist:
97+
name: Build source distribution
98+
runs-on: ubuntu-latest
99+
steps:
100+
- name: Check out repository at workflow sha
101+
uses: actions/checkout@v6
102+
with:
103+
fetch-depth: 0
104+
ref: ${{ github.sha }}
105+
- name: Force correct release branch on workflow sha
106+
run: git checkout -B ${{ github.ref_name }} ${{ github.sha }}
107+
- name: Setup up Python
108+
uses: actions/setup-python@v6
109+
with:
110+
python-version: '3.14'
111+
# to build the package, a preview of the released version is created but not committed
112+
- name: Create release preview
113+
run: |
114+
python -m pip install --upgrade pip
115+
pip install build wheel python-semantic-release
116+
semantic-release version --no-commit --skip-build --no-vcs-release --no-tag
117+
- name: Install build dependencies
118+
run: |
119+
python -m pip install --upgrade pip
120+
pip install build
121+
- name: Build sdist
122+
run: python -m build --sdist
123+
- uses: actions/upload-artifact@v6
124+
with:
125+
name: cibw-sdist
126+
path: dist/*.tar.gz
127+
17128
release-package:
129+
needs: [build-wheels, build-sdist]
18130
if: github.repository == 'ai4trees/pointtree' && github.ref_name == 'main'
19-
runs-on: ubuntu-latest
131+
runs-on: 'ubuntu-latest'
20132
steps:
21133
- name: Clean up potential remnants of past jobs
22134
uses: AutoModality/action-clean@v1.1.0
23-
# Note: we need to checkout the repository at the workflow sha in case during the workflow
24-
# the branch was updated. To keep PSR working with the configured release branches,
25-
# we force a checkout of the desired release branch but at the workflow sha HEAD.
26135
- name: Check out repository at workflow sha
27-
uses: actions/checkout@v4
136+
uses: actions/checkout@v6
28137
with:
29-
token: ${{ secrets.RELEASE_TOKEN }}
30138
fetch-depth: 0
31139
ref: ${{ github.sha }}
32140
- name: Force correct release branch on workflow sha
@@ -35,26 +143,33 @@ jobs:
35143
git config --global user.email "github-actions[bot]@users.noreply.github.com"
36144
git config --global user.name "github-actions[bot]"
37145
git checkout -B ${{ github.ref_name }} ${{ github.sha }}
38-
- name: Install build and package dependencies
146+
- uses: actions/download-artifact@v4
147+
with:
148+
# unpacks all CIBW artifacts into dist/
149+
pattern: cibw-*
150+
path: dist
151+
merge-multiple: true
152+
- name: Setup up Python
153+
uses: actions/setup-python@v6
154+
with:
155+
python-version: '3.14'
156+
- name: Install build dependencies
39157
run: |
40158
python -m pip install --upgrade pip
41-
pip install build wheel python-semantic-release setuptools
42-
pip install torch==2.4.0
43-
pip install torch-scatter -f https://data.pyg.org/whl/torch-2.4.0+cpu.html
44-
pip install torch-cluster -f https://data.pyg.org/whl/torch-2.4.0+cpu.html
45-
python -m pip install .
159+
pip install build wheel python-semantic-release
46160
- name: Create release
47161
id: release
48162
run: |
49-
semantic-release version
163+
git config --global --add safe.directory $(realpath .)
164+
semantic-release version --skip-build
50165
env:
51-
PSR_DOCKER_GITHUB_ACTION: true
52-
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
166+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53167
- name: Publish package to TestPyPI
54168
uses: pypa/gh-action-pypi-publish@release/v1
55169
if: steps.release.outputs.released == 'true'
56170
with:
57171
repository-url: https://test.pypi.org/legacy/
172+
user: __token__
58173
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
59174
- name: Test install from TestPyPI
60175
run: |
@@ -66,4 +181,5 @@ jobs:
66181
uses: pypa/gh-action-pypi-publish@release/v1
67182
if: steps.release.outputs.released == 'true'
68183
with:
184+
user: __token__
69185
password: ${{ secrets.PYPI_API_TOKEN }}

CMakeLists.txt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,23 @@ set(PYBIND11_NEWPYTHON ON)
66
find_package(pybind11 CONFIG REQUIRED)
77

88
if(APPLE)
9+
10+
set(OPENMP_ROOT "" CACHE PATH "Prefix where libomp is installed (has include/ and lib/)")
11+
12+
if(OPENMP_ROOT)
13+
message(STATUS "Using OPENMP_ROOT=${OPENMP_ROOT}")
14+
set(OpenMP_CXX "${CMAKE_CXX_COMPILER}")
15+
set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I${OPENMP_ROOT}/include")
16+
set(OpenMP_CXX_LIB_NAMES "omp")
17+
set(OpenMP_omp_LIBRARY "${OPENMP_ROOT}/lib/libomp.dylib")
18+
else()
919
execute_process(COMMAND brew --prefix OUTPUT_VARIABLE BREW_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
20+
message(STATUS "Using Homebrew OpenMP from ${BREW_PREFIX}/opt/libomp")
1021
set(OpenMP_CXX "${CMAKE_CXX_COMPILER}")
1122
set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I${BREW_PREFIX}/opt/libomp/include")
12-
set(OpenMP_CXX_LIB_NAMES "libomp")
13-
set(OpenMP_libomp_LIBRARY "omp")
14-
include_directories("${BREW_PREFIX}/opt/libomp/include")
15-
link_directories("${BREW_PREFIX}/opt/libomp/lib")
23+
set(OpenMP_CXX_LIB_NAMES "omp")
24+
set(OpenMP_omp_LIBRARY "${BREW_PREFIX}/opt/libomp/lib/libomp.dylib")
25+
endif()
1626
endif()
1727

1828
find_package(OpenMP REQUIRED)

0 commit comments

Comments
 (0)