update README.md #38
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
# From: | |
# - https://github.com/reshalfahsi/separableconv-torch/blob/main/.github/workflows/ci.yml | |
name: ci testing | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
lint-python: | |
runs-on: ${{ matrix.os }} | |
continue-on-error: true | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9] | |
os: [ubuntu-latest] | |
name: Lint Python | |
steps: | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Install lint dependencies | |
env: | |
# on macOS and with Python 3.10: building NumPy from source fails without these options: | |
NPY_BLAS_ORDER: "" | |
NPY_LAPACK_ORDER: "" | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
pip install -r requirements.txt | |
- name: Lint Python code | |
run: flake8 . --count --ignore=W503,E203,W504,F403,F401,E501,E402 --exclude .git,dist,doc,build,vendors --show-source --statistics | |
- name: Check Python formatting | |
run: black neuralnetwork tests setup.py --preview --diff --check | |
build: | |
needs: [lint-python] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
operating-system: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: [3.7, 3.8, 3.9] | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Restore Ubuntu cache | |
uses: actions/cache@v1 | |
if: matrix.operating-system == 'ubuntu-latest' | |
with: | |
path: ~/.cache/pip | |
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}} | |
restore-keys: ${{ matrix.os }}-${{ matrix.python-version }}- | |
- name: Restore MacOS cache | |
uses: actions/cache@v1 | |
if: matrix.operating-system == 'macos-latest' | |
with: | |
path: ~/Library/Caches/pip | |
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}} | |
restore-keys: ${{ matrix.os }}-${{ matrix.python-version }}- | |
- name: Restore Windows cache | |
uses: actions/cache@v1 | |
if: matrix.operating-system == 'windows-latest' | |
with: | |
path: ~\AppData\Local\pip\Cache | |
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}} | |
restore-keys: ${{ matrix.os }}-${{ matrix.python-version }}- | |
- name: Update pip | |
run: python -m pip install --upgrade pip | |
- name: Install dependencies | |
env: | |
# on macOS and with Python 3.10: building NumPy from source fails without these options: | |
NPY_BLAS_ORDER: "" | |
NPY_LAPACK_ORDER: "" | |
run: > | |
pip install -r requirements.txt | |
- name: Test with pytest | |
run: | | |
pytest --tb=short -q tests/ |