Daily Testing #188
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: Daily Testing | |
on: | |
schedule: | |
# https://crontab.guru. Run everyday at 0:00AM UTC, i.e. 08:00AM Beijing, i.e. 08:00PM Montreal (summer time) | |
- cron: "0 0 * * *" | |
jobs: | |
Daily-testing: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
python-version: ["3.7", "3.8", "3.9", "3.10"] | |
torch-version: ["1.13.1"] | |
steps: | |
- name: Check out the repo code | |
uses: actions/checkout@v3 | |
- name: Determine the Python version | |
uses: haya14busa/action-cond@v1 | |
id: condval | |
with: | |
cond: ${{ matrix.python-version == 3.7 && matrix.os == 'macOS-latest' }} | |
# Note: the latest 3.7 subversion 3.7.17 for MacOS has "ModuleNotFoundError: No module named '_bz2'" | |
if_true: "3.7.16" | |
if_false: ${{ matrix.python-version }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ steps.condval.outputs.value }} | |
check-latest: true | |
cache: pip | |
cache-dependency-path: | | |
setup.cfg | |
- name: Install PyTorch ${{ matrix.torch-version }}+cpu | |
# we have to install torch in advance because torch_sparse needs it for compilation, | |
# refer to https://github.com/rusty1s/pytorch_sparse/issues/156#issuecomment-1304869772 for details | |
run: | | |
which python | |
which pip | |
python -m pip install --upgrade pip | |
pip install torch==${{ matrix.torch-version }} -f https://download.pytorch.org/whl/cpu | |
python -c "import torch; print('PyTorch:', torch.__version__)" | |
- name: Install other dependencies | |
run: | | |
pip install pypots | |
pip install torch-geometric torch-scatter torch-sparse -f "https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html" | |
pip install -e ".[dev]" | |
- name: Fetch the test environment details | |
run: | | |
which python | |
pip list | |
- name: Test with pytest | |
run: | | |
coverage run --source=pypots -m pytest --ignore tests/test_training_on_multi_gpus.py | |
# ignore the test_training_on_multi_gpus.py because it requires multiple GPUs which are not available on GitHub Actions | |
- name: Generate the LCOV report | |
run: | | |
python -m coverage lcov | |
- name: Submit the report | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: "coverage.lcov" |