ci.yml 1.9 KB

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