2020-12-08 14:55:06 -05:00
|
|
|
name: CI
|
2020-12-16 13:23:45 -05:00
|
|
|
on: [push, pull_request]
|
2020-12-08 14:55:06 -05:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-07-19 10:43:52 -04:00
|
|
|
python-version: [3.7, 3.8, 3.9]
|
2020-12-08 14:55:06 -05:00
|
|
|
services:
|
|
|
|
redis:
|
|
|
|
image: redis
|
|
|
|
ports:
|
|
|
|
- 6379:6379
|
|
|
|
postgres:
|
|
|
|
image: postgres
|
|
|
|
env:
|
|
|
|
POSTGRES_USER: netbox
|
|
|
|
POSTGRES_PASSWORD: netbox
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check out repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: Install dependencies & set up configuration
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install -r requirements.txt
|
|
|
|
pip install pycodestyle coverage
|
|
|
|
ln -s configuration.testing.py netbox/netbox/configuration.py
|
|
|
|
|
2021-07-19 14:18:08 -04:00
|
|
|
- name: Build documentation
|
|
|
|
run: mkdocs build
|
|
|
|
|
2021-04-27 13:42:57 -04:00
|
|
|
- name: Collect static files
|
2021-04-27 13:47:29 -04:00
|
|
|
run: python netbox/manage.py collectstatic --no-input
|
2021-04-27 13:42:57 -04:00
|
|
|
|
2020-12-08 14:55:06 -05:00
|
|
|
- name: Check PEP8 compliance
|
|
|
|
run: pycodestyle --ignore=W504,E501 netbox/
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: coverage run --source="netbox/" netbox/manage.py test netbox/
|
|
|
|
|
|
|
|
- name: Show coverage report
|
|
|
|
run: coverage report --skip-covered --omit *migrations*
|