ci.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. name: CI
  2. on: [push, pull_request]
  3. jobs:
  4. build:
  5. runs-on: ubuntu-latest
  6. env:
  7. NETBOX_CONFIGURATION: netbox.configuration_testing
  8. strategy:
  9. matrix:
  10. python-version: ['3.8', '3.9', '3.10']
  11. node-version: ['14.x']
  12. services:
  13. redis:
  14. image: redis
  15. ports:
  16. - 6379:6379
  17. postgres:
  18. image: postgres
  19. env:
  20. POSTGRES_USER: netbox
  21. POSTGRES_PASSWORD: netbox
  22. options: >-
  23. --health-cmd pg_isready
  24. --health-interval 10s
  25. --health-timeout 5s
  26. --health-retries 5
  27. ports:
  28. - 5432:5432
  29. steps:
  30. - name: Check out repo
  31. uses: actions/checkout@v2
  32. - name: Set up Python ${{ matrix.python-version }}
  33. uses: actions/setup-python@v2
  34. with:
  35. python-version: ${{ matrix.python-version }}
  36. - name: Use Node.js ${{ matrix.node-version }}
  37. uses: actions/setup-node@v2
  38. with:
  39. node-version: ${{ matrix.node-version }}
  40. - name: Install Yarn Package Manager
  41. run: npm install -g yarn
  42. - name: Setup Node.js with Yarn Caching
  43. uses: actions/setup-node@v2
  44. with:
  45. node-version: ${{ matrix.node-version }}
  46. cache: yarn
  47. cache-dependency-path: netbox/project-static/yarn.lock
  48. - name: Install Frontend Dependencies
  49. run: yarn --cwd netbox/project-static
  50. - name: Install dependencies & set up configuration
  51. run: |
  52. python -m pip install --upgrade pip
  53. pip install -r requirements.txt
  54. pip install pycodestyle coverage
  55. - name: Build documentation
  56. run: mkdocs build
  57. - name: Collect static files
  58. run: python netbox/manage.py collectstatic --no-input
  59. - name: Check PEP8 compliance
  60. run: pycodestyle --ignore=W504,E501 --exclude=node_modules netbox/
  61. - name: Check UI ESLint, TypeScript, and Prettier Compliance
  62. run: yarn --cwd netbox/project-static validate
  63. - name: Validate Static Asset Integrity
  64. run: scripts/verify-bundles.sh
  65. - name: Run tests
  66. run: coverage run --source="netbox/" netbox/manage.py test netbox/ --parallel
  67. - name: Show coverage report
  68. run: coverage report --skip-covered --omit *migrations*