fix typo #219
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
description: "Run the build with tmate debugging enabled" | |
required: false | |
jobs: | |
tox: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
tox-env: [lint, type, apidoc-check] | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout latest commit | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # fetch all history with version tags | |
- name: Set up python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.8" | |
- name: Set up pip cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ matrix.tox-env }}-${{ runner.os }}-${{ hashFiles('tox.ini') }} | |
- name: Set up environment | |
run: | | |
pip install --upgrade pip wheel setuptools | |
pip install tox | |
- name: Run tox ${{ matrix.tox-env }} | |
run: tox -vv -e ${{ matrix.tox-env }} | |
unit-tests: | |
runs-on: ${{ matrix.os }} | |
env: | |
PIP_CACHE_DIR: .cache/pip | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python-version: [3.8] | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout latest commit | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # fetch all history with version tags | |
- name: Set up python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up pip cache | |
uses: actions/cache@v2 | |
with: | |
path: .cache/pip | |
key: ${{ matrix.python-version }}-${{ matrix.os }} | |
- name: Set up environment | |
run: | | |
pip install --upgrade pip wheel setuptools | |
TORCH=$(grep 'torch==' requirements.txt | sed -re "s/torch==([^+]+).*/\1/") | |
CUDA=cpu | |
PYG_FIND_LINKS="https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html" | |
if [ "${{ matrix.os }}" == "ubuntu-latest" ] | |
then | |
TORCH_FLAVOUR="+$CUDA" | |
else | |
TORCH_FLAVOUR="" | |
fi | |
pip install torch==${TORCH}${TORCH_FLAVOUR} --find-links "https://download.pytorch.org/whl/torch_stable.html" | |
pip install -r requirements.txt -c constraints.txt | |
pip install $PWD -c constraints.txt | |
pip install torch-scatter torch-sparse torch-cluster torch-spline-conv --no-index --find-links $PYG_FIND_LINKS | |
pip install 'torch-geometric<2' | |
pip install pytest pytest-cov pytest-mock | |
- name: Set up tmate session | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} | |
- name: Run unit tests | |
run: pytest --verbose --durations=15 --cov -ra |