Skip to content

test

test #132

Workflow file for this run

# This workflow will install Python dependencies, run tests, and report the coverage with a variety of Python versions and OSs.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: test
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# * is a special character in YAML, so you have to quote this string
- cron: "0 0 * * *" # every midnight
jobs:
test:
env:
DROPBOX_APP_KEY: ${{ secrets.DROPBOX_APP_KEY }}
DROPBOX_APP_SECRET: ${{ secrets.DROPBOX_APP_SECRET }}
DROPBOX_REFRESH_TOKEN: ${{ secrets.DROPBOX_REFRESH_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: |
pyproject.toml
requirements*.txt
- name: Install dependencies
env:
PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev]
# PyG compiled extensions (need the wheel index)
python -m pip install \
-f https://data.pyg.org/whl/torch-2.6.0+cpu.html \
torch_scatter==2.1.2 torch_sparse==0.6.18 torch_cluster==1.6.3 torch_spline_conv==1.2.2
- name: Download datasets from Dropbox (optional)
if: ${{ env.DROPBOX_REFRESH_TOKEN != '' }}
continue-on-error: true
run: |
python -m tests.dropbox_download \
"/MMAI25Hackathon" \
"MMAI25Hackathon" \
--app-key "$DROPBOX_APP_KEY" \
--app-secret "$DROPBOX_APP_SECRET" \
--refresh-token "$DROPBOX_REFRESH_TOKEN" \
--unzip
- name: Run tests
env:
OMP_NUM_THREADS: "1"
MKL_NUM_THREADS: "1"
NUMEXPR_NUM_THREADS: "1"
run: pytest --cov=mmai25_hackathon
- name: Generate coverage XML
run: coverage xml
- name: Upload coverage to Codecov (optional)
if: ${{ env.CODECOV_TOKEN != '' }}
uses: codecov/codecov-action@v4
with:
token: ${{ env.CODECOV_TOKEN }}