ci.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. name: CI
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. jobs:
  8. dist:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/setup-python@v4
  12. with:
  13. python-version: "3.10"
  14. - uses: actions/checkout@v3
  15. - run: python -m pip install --upgrade pip build wheel twine
  16. - run: python -m build --sdist --wheel
  17. - run: python -m twine check dist/*
  18. standardjs:
  19. runs-on: ubuntu-latest
  20. steps:
  21. - uses: actions/setup-node@v3
  22. with:
  23. node-version: '14.x'
  24. - uses: actions/checkout@v3
  25. - id: cache-npm
  26. uses: actions/cache@v3
  27. with:
  28. path: ~/.npm
  29. key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
  30. restore-keys: |
  31. ${{ runner.os }}-node-
  32. - name: Install Node dependencies
  33. run: npm ci
  34. - run: npm run lint:js
  35. lint:
  36. runs-on: ubuntu-latest
  37. strategy:
  38. matrix:
  39. lint-command:
  40. - bandit -r . -x ./tests
  41. - black --check --diff .
  42. - flake8 .
  43. - isort --check-only --diff .
  44. - pydocstyle .
  45. steps:
  46. - uses: actions/checkout@v3
  47. - uses: actions/setup-python@v4
  48. with:
  49. python-version: "3.10"
  50. cache: 'pip'
  51. cache-dependency-path: 'linter-requirements.txt'
  52. - run: python -m pip install -r linter-requirements.txt
  53. - run: ${{ matrix.lint-command }}
  54. pytest:
  55. needs:
  56. - lint
  57. - standardjs
  58. - dist
  59. runs-on: ubuntu-latest
  60. strategy:
  61. matrix:
  62. python-version:
  63. - "3.8"
  64. - "3.9"
  65. - "3.10"
  66. django-version:
  67. - "3.2"
  68. - "4.0"
  69. steps:
  70. - uses: actions/checkout@v3
  71. - name: Set up Python ${{ matrix.python-version }}
  72. uses: actions/setup-python@v4
  73. with:
  74. python-version: ${{ matrix.python-version }}
  75. - name: Install Chrome
  76. run: |
  77. sudo apt update
  78. sudo apt install -y google-chrome-stable
  79. - name: Install Selenium
  80. run: |
  81. mkdir bin
  82. curl -qO "https://chromedriver.storage.googleapis.com/$(curl -q https://chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip"
  83. unzip chromedriver_linux64.zip -d bin
  84. - run: python -m pip install .[test] codecov
  85. - run: python -m pip install django~=${{ matrix.django-version }}
  86. - run: python -m pytest
  87. env:
  88. PATH: $PATH:$(pwd)/bin
  89. - run: codecov