Skip to content

CI

CI #2684

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 3 * * 1'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.10", "3.11", "3.12"]
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Checkout GCNN
uses: actions/checkout@v4
- name: Install MPI
run: |
sudo apt-get update
sudo apt-get install -y libopenmpi-dev
sudo apt-get clean
- name: Cache pip
uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements-base.txt') }}-${{ hashFiles('requirements-dev.txt') }}-${{ hashFiles('requirements-torch.txt') }}-${{ hashFiles('requirements-pyg.txt') }}-${{ hashFiles('requirements-deepspeed.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --no-build-isolation -v --upgrade -r requirements-base.txt -r requirements-dev.txt
python -m pip install --no-build-isolation -v --upgrade -r requirements-torch.txt --index-url https://download.pytorch.org/whl/cpu --extra-index-url https://pypi.org/simple
python -m pip install --no-build-isolation -v --upgrade -r requirements-pyg.txt --find-links https://data.pyg.org/whl/torch-2.8.0+cpu.html
python -m pip install --no-build-isolation -v --upgrade -r requirements-deepspeed.txt || echo "DeepSpeed installation failed, continuing without it"
- name: Show installed packages
run: |
echo "=== Installed package versions ==="
pip list | grep -E "(numpy|scipy|torch|scikit-learn|matplotlib|ase|tensorboard)"
- name: Format black
run: |
black .
git diff --exit-code
- name: Run pytest
run: |
# FIXME: install
export PYTHONPATH=$PYTHONPATH:~/HydraGNN
pip list
# Check if DeepSpeed is available
if python -c "import deepspeed" 2>/dev/null; then
echo "DeepSpeed available - running all tests"
python -m pytest -rfEP -W error -W ignore::DeprecationWarning -W ignore::UserWarning --tb=native
mpirun -n 2 --oversubscribe python -m pytest -rfEP -W error -W ignore::DeprecationWarning -W ignore::UserWarning --tb=native --with-mpi
else
echo "DeepSpeed not available - skipping GPU/DeepSpeed tests"
python -m pytest -rfEP -W error -W ignore::DeprecationWarning -W ignore::UserWarning --tb=native -m "not gpu and not deepspeed"
mpirun -n 2 --oversubscribe python -m pytest -rfEP -W error -W ignore::DeprecationWarning -W ignore::UserWarning --tb=native --with-mpi -m "not gpu and not deepspeed"
fi