Skip to content

[pre-commit.ci] auto fixes from pre-commit.com hooks #253

[pre-commit.ci] auto fixes from pre-commit.com hooks

[pre-commit.ci] auto fixes from pre-commit.com hooks #253

Workflow file for this run

name: Python package
on: [push]
jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11"]
torch-version: [2.0.0, 2.1.0]
include:
- torch-version: 2.0.0
torchvision-version: 0.15.1
- torch-version: 2.1.0
torchvision-version: 0.16.0
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install PyTorch ${{ matrix.torch-version }}+cpu
run: |
pip install torch==${{ matrix.torch-version}}+cpu torchvision==${{ matrix.torchvision-version}}+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install internal dependencies
run: |
pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html
- name: Install main package
run: |
pip install -e .
pip install pytest-xdist
- name: Setup with pytest-xdist
run: |
# lets get the string for how many cpus to use with pytest
echo "Will be using ${{ inputs.pytest_numcpus }} cpus for pytest testing"
#
# make PYTESTXDIST
export PYTESTXDIST="-n 2"
if [ 2 -gt 0 ]; then export PYTESTXDIST="$PYTESTXDIST --dist=loadfile"; fi
#
# echo results and save env var for other jobs
echo "pytest-xdist options that will be used are: $PYTESTXDIST"
echo "PYTESTXDIST=$PYTESTXDIST" >> $GITHUB_ENV
- name: Setup with pytest-cov
run: |
# let make pytest run with coverage
echo "Will be looking at coverage of dir graph_weather"
#
# install pytest-cov
pip install coverage==6.2 # https://github.com/nedbat/coveragepy/issues/1312
pip install pytest-cov
#
# make PYTESTCOV
export PYTESTCOV="--cov=graph_weather--cov-report=xml"
# echo results and save env var for other jobs
echo "pytest-cov options that will be used are: $PYTESTCOV"
echo "PYTESTCOV=$PYTESTCOV" >> $GITHUB_ENV
- name: Run pytest
run: |
export PYTEST_COMMAND="pytest $PYTESTCOV $PYTESTXDIST -s"
echo "Will be running this command: $PYTEST_COMMAND"
eval $PYTEST_COMMAND
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: false