ubuntu.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. on:
  2. workflow_dispatch: # Manually running a workflow
  3. name: Linux build
  4. jobs:
  5. test-ubuntu:
  6. runs-on: ubuntu-latest
  7. strategy:
  8. fail-fast: false
  9. matrix:
  10. #python-version: [ 3.7, 3.8, 3.9 ]
  11. python-version: [ 3.9 ]
  12. steps:
  13. - uses: actions/checkout@v2
  14. - name: Cache pip
  15. uses: actions/cache@v2
  16. if: startsWith(runner.os, 'Linux')
  17. with:
  18. path: ~/.cache/pip
  19. key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
  20. restore-keys: |
  21. ${{ runner.os }}-pip-
  22. - name: Cache huggingface models
  23. uses: actions/cache@v2
  24. with:
  25. path: ~/.cache/huggingface
  26. key: ${{ runner.os }}-huggingface-
  27. - name: Cache pycorrector models
  28. uses: actions/cache@v2
  29. with:
  30. path: ~/.pycorrector
  31. key: ${{ runner.os }}-pycorrector-
  32. - name: Set up Python
  33. uses: actions/setup-python@v2
  34. with:
  35. python-version: ${{ matrix.python-version }}
  36. - name: Install torch
  37. run: |
  38. python -m pip install --upgrade pip
  39. pip install Cython
  40. pip install torch
  41. - name: Install from pypi
  42. run: |
  43. pip install -U pycorrector
  44. pip uninstall -y pycorrector
  45. - name: Install dependencies
  46. run: |
  47. pip install -r requirements.txt
  48. pip install .
  49. pip install pytest
  50. # - name: PKG-TEST
  51. # run: |
  52. # python -m pytest
  53. # echo "PKG-TEST done"