Thanks to visit codestin.com
Credit goes to github.com

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
8 changes: 0 additions & 8 deletions .github/workflows/_build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ on: # yamllint disable-line rule:truthy
test-matrix:
type: string
required: true
test-python:
type: boolean
required: true
# TODO: Run C++ tests
# test-cpp:
# type: boolean
# required: true

defaults:
run:
Expand Down Expand Up @@ -67,7 +60,6 @@ jobs:
cd ..

- name: Test wheel
if: ${{ inputs.test-python }}
run: |
pip install pytest pytest-cov
pytest --cov --cov-report=xml
61 changes: 61 additions & 0 deletions .github/workflows/_build_macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build macOS Wheels

on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
test-matrix:
type: string
required: true

defaults:
run:
shell: bash

jobs:
wheel:
runs-on: macos-14
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(inputs.test-matrix) }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
uses: ./.github/actions/setup
with:
python-version: ${{ matrix.python-version }}
torch-version: ${{ matrix.torch-version }}
cuda-version: ${{ matrix.cuda-version }}

- name: Set version
run: |
VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" pyg_lib/__init__.py`
TORCH_VERSION=`echo "pt${{ matrix.torch-version }}" | sed "s/..$//" | sed "s/\.//g"`
echo "New version name: $VERSION+$TORCH_VERSION"
sed -i "" "s/$VERSION/$VERSION+$TORCH_VERSION/" setup.py
sed -i "" "s/$VERSION/$VERSION+$TORCH_VERSION/" pyg_lib/__init__.py

- name: Build wheel
run: |
source ./.github/workflows/cuda/macOS-env.sh ${{ matrix.cuda-version }}
pip install build
python -m build --wheel --no-isolation --outdir dist

- name: Install wheel
run: |
cd dist
ls -lah
pip install *.whl
python -c "import pyg_lib; print('pyg-lib:', pyg_lib.__version__)"
python -c "import pyg_lib; print('CUDA:', pyg_lib.cuda_version())"
cd ..

- name: Test wheel
run: |
pip install pytest pytest-cov
pytest --cov --cov-report=xml
32 changes: 25 additions & 7 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@ on: # yamllint disable-line rule:truthy
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ startsWith(github.ref, 'refs/pull/') || github.run_number }} # yamllint disable-line
# Only cancel intermediate builds if on a PR:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
trigger:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
linux-matrix: ${{ steps.set-matrix.outputs.linux-matrix }}
macos-matrix: ${{ steps.set-matrix.outputs.macos-matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

# TODO: Filter out the matrix.json based on PR changes or labels.
- name: Read and flatten matrix.json
- name: Configure matrix
id: set-matrix
run: |
if [ -n "$GITHUB_EVENT_NAME" ] && [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
Expand All @@ -23,13 +29,25 @@ jobs:
# TODO: Use full_matrix.json once workflows are ready.
filename=".github/workflows/utils/minimal_matrix.json"
fi

# Set Linux matrix
matrix=$(jq -c '[.[] | { "torch-version": .["torch-version"], "python-version": .["python-version"][], "cuda-version": .["cuda-version"][] }]' $filename)
echo "matrix=$matrix" >> $GITHUB_OUTPUT
echo "matrix=$matrix"
echo "linux-matrix=$matrix" >> $GITHUB_OUTPUT
echo "linux-matrix=$matrix"

# Set macOS matrix
matrix=$(jq -c '[.[] | { "torch-version": .["torch-version"], "python-version": .["python-version"][], "cuda-version": "cpu" }]' $filename)
echo "macos-matrix=$matrix" >> $GITHUB_OUTPUT
echo "macos-matrix=$matrix"

test-linux:
linux:
needs: [trigger]
uses: ./.github/workflows/_build_linux.yml
with:
test-matrix: ${{ needs.trigger.outputs.matrix }}
test-python: true
test-matrix: ${{ needs.trigger.outputs.linux-matrix }}

macos:
needs: [trigger]
uses: ./.github/workflows/_build_macos.yml
with:
test-matrix: ${{ needs.trigger.outputs.macos-matrix }}
Loading