Merge pull request #2 from darnfish/master

Run Tests in CI
This commit is contained in:
George Hotz 2020-10-18 13:33:58 -07:00 committed by GitHub
commit 55f9db8af6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 1 deletions

26
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Unit Tests
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Dependencies
run: pip install ipython numpy tqdm requests
- name: Run Tests
run: ipython3 test/mnist.py

View File

@ -2,7 +2,7 @@ def fetch_mnist():
def fetch(url):
import requests, gzip, os, hashlib, numpy
fp = os.path.join("/tmp", hashlib.md5(url.encode('utf-8')).hexdigest())
if not os.path.isfile(fp):
if os.path.isfile(fp):
with open(fp, "rb") as f:
dat = f.read()
else: