mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-10 15:38:29 -05:00
* fixed pylint, formatted python files iwth cblack on localhost
* Revert "fixed pylint, formatted python files iwth cblack on localhost"
This reverts commit 07e2b88466.
* dedented 4-spaces added linter
Co-authored-by: Iain Wong <iainwong@outlook.com>
56 lines
1.4 KiB
YAML
56 lines
1.4 KiB
YAML
name: Unit Tests
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
lines:
|
|
name: Less than 1000 lines
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v2
|
|
- name: Install SLOCCount
|
|
run: sudo apt-get install sloccount
|
|
- name: Check <1000 lines
|
|
run: sloccount tinygrad test examples; if [ $(sloccount tinygrad | sed -n 's/.*Total Physical Source Lines of Code (SLOC)[ ]*= \([^ ]*\).*/\1/p' | tr -d ',') -gt 1000 ]; then exit 1; fi
|
|
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v2
|
|
- name: Install OpenCL
|
|
run: sudo apt-get install pocl-opencl-icd
|
|
- name: Set up Python 3.8
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.8
|
|
- name: Install Dependencies
|
|
run: pip install -e '.[gpu,testing]'
|
|
- name: Run Pytest
|
|
run: python -m pytest -s -v
|
|
|
|
linter:
|
|
name: Indentation Linter
|
|
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: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install pylint
|
|
# pip install -r requirements.txt
|
|
- name: Lint with pylint
|
|
run: |
|
|
python -m pylint --disable=all -e W0311 --jobs=0 --indent-string=' ' **/*.py
|
|
|