2
0

ci.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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.6, 3.7, 3.8]
  9. services:
  10. redis:
  11. image: redis
  12. ports:
  13. - 6379:6379
  14. postgres:
  15. image: postgres
  16. env:
  17. POSTGRES_USER: netbox
  18. POSTGRES_PASSWORD: netbox
  19. options: >-
  20. --health-cmd pg_isready
  21. --health-interval 10s
  22. --health-timeout 5s
  23. --health-retries 5
  24. ports:
  25. - 5432:5432
  26. steps:
  27. - name: Check out repo
  28. uses: actions/checkout@v2
  29. - name: Set up Python ${{ matrix.python-version }}
  30. uses: actions/setup-python@v2
  31. with:
  32. python-version: ${{ matrix.python-version }}
  33. - name: Install dependencies & set up configuration
  34. run: |
  35. python -m pip install --upgrade pip
  36. pip install -r requirements.txt
  37. pip install pycodestyle coverage
  38. ln -s configuration.testing.py netbox/netbox/configuration.py
  39. - name: Check PEP8 compliance
  40. run: pycodestyle --ignore=W504,E501 netbox/
  41. - name: Run tests
  42. run: coverage run --source="netbox/" netbox/manage.py test netbox/
  43. - name: Show coverage report
  44. run: coverage report --skip-covered --omit *migrations*