name: Building on: [workflow_dispatch] jobs: building: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest] python-version: [3.9] torch-version: [1.9.0] cuda-version: ['cu111'] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Update pip run: | pip install --upgrade pip python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)" - name: Get pip cache id: pip-cache run: | python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)" - name: Cache pip uses: actions/cache@v2 with: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-torch==${{ matrix.torch-version }}+${{ matrix.cuda-version }} - name: Install CUDA ${{ matrix.cuda-version }} if: ${{ matrix.cuda-version != 'cpu' }} run: | source .github/workflows/cuda/${{ matrix.cuda-version }}-${{ runner.os }}.sh - name: Install PyTorch ${{ matrix.torch-version }}+${{ matrix.cuda-version }} run: | pip install torch==${{ matrix.torch-version}}+${{ matrix.cuda-version }} -f https://download.pytorch.org/whl/torch_stable.html - name: Install main package for CPU: if: ${{ matrix.cuda-version == 'cpu' }} run: | FORCE_ONLY_CPU=1 pip install -e . ls -lah torch_scatter/ - name: Install main package with CUDA: if: ${{ matrix.cuda-version != 'cpu' }} run: | source .github/workflows/cuda/${{ matrix.cuda-version }}-${{ runner.os }}-env.sh FORCE_CUDA=1 pip install -e . ls -lah torch_scatter/ - name: Build wheel run: | pip install wheel python setup.py bdist_wheel --dist-dir=dist ls -lah dist/ - name: Upload wheel uses: shallwefootball/s3-upload-action@master with: aws_key_id: ${{ secrets.AWS_KEY_ID }} aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} aws_bucket: ${{ pytorch-geometric.com }} source_dir: 'dist' destination_dir: 'whl/torch-${{ matrix.torch-version }}+${{ matrix.cuda-version }}'