windows.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. on:
  2. workflow_dispatch: # Manually running a workflow
  3. name: Windows build
  4. jobs:
  5. test-windows:
  6. runs-on: windows-latest
  7. steps:
  8. - uses: actions/checkout@v2
  9. - name: Cache pip
  10. uses: actions/cache@v2
  11. if: startsWith(runner.os, 'Windows')
  12. with:
  13. path: ~\AppData\Local\pip\Cache
  14. key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
  15. restore-keys: |
  16. ${{ runner.os }}-pip-
  17. - name: Cache huggingface models
  18. uses: actions/cache@v2
  19. with:
  20. path: ~/.cache/huggingface
  21. key: ${{ runner.os }}-huggingface-
  22. - name: Cache pycorrector models
  23. uses: actions/cache@v2
  24. with:
  25. path: ~/.pycorrector
  26. key: ${{ runner.os }}-pycorrector-
  27. - name: Install miniconda
  28. uses: conda-incubator/setup-miniconda@v2
  29. with:
  30. auto-activate-base: true
  31. python-version: 3.9
  32. - name: Install torch
  33. run: |
  34. python -m pip install --upgrade pip
  35. pip install torch
  36. - name: Test torch installation
  37. run: |
  38. python -c "import sys; print(sys.version)"
  39. python -c "import torch; print(torch.__version__)"
  40. - name: Install from pypi
  41. run: |
  42. pip install -U pycorrector
  43. pip uninstall -y pycorrector
  44. - name: Install dependencies
  45. run: |
  46. python -m pip install --upgrade pip
  47. pip install Cython
  48. pip install -r requirements.txt
  49. pip install .