add mypy + pre commit hooks #25
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: Unit Tests | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
testmnist: | |
name: Train mnist | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install Dependencies | |
run: pip install numpy tqdm | |
- name: Get code size | |
- name: Train MNIST | |
run: PYTHONPATH="." python mnist.py | |
- name: Install mypy + torch for testing | |
run: pip install mypy torch --extra-index-url https://download.pytorch.org/whl/cpu | |
- name: Test ops / dtype / optim | |
run: | | |
PYTHONPATH="." python test/test_ops.py | |
PYTHONPATH="." python test/test_dtype.py | |
PYTHONPATH="." python test/test_optim.py | |
- name: Check types with mypy | |
run: mypy |