Build and Test #708
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: Build and Test | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
schedule: | |
# Run the tests at 00:00 each day | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.8] | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: cache conda | |
uses: actions/cache@v2 | |
env: | |
# Increase this value to reset cache if etc/example-environment.yml has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: | |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ | |
hashFiles('requirements.txt') }} | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: test | |
python-version: 3.8 | |
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | |
- name: Set up env | |
run: | | |
conda activate test | |
conda install pip | |
- name: Cache pip | |
uses: actions/cache@v2 | |
with: | |
# This path is specific to Ubuntu | |
path: ~/.cache/pip | |
# Look to see if there is a cache hit for the corresponding requirements file | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
${{ runner.os }}- | |
- name: pytorch | |
run: | | |
conda install -y pytorch=1.7.1 torchvision cudatoolkit=10.2 -c pytorch --update-deps | |
- name: Install pyG | |
run: | | |
./pyG_install.sh cu102 | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Test with pytest | |
run: | | |
pytest -v |