mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-13 16:47:34 -06:00

* Resolve F541 errors * Resolve F841 errors * Resolve F811 errors * Resolve F901 errors * Resolve E714 errors * Ignore F821 errors for GraphQL mixins * Replace pycodestyle with ruff * Move ignores to ruff.toml
101 lines
2.5 KiB
YAML
101 lines
2.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- 'contrib/**'
|
|
- 'docs/**'
|
|
- 'netbox/translations/**'
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'contrib/**'
|
|
- 'docs/**'
|
|
- 'netbox/translations/**'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
NETBOX_CONFIGURATION: netbox.configuration_testing
|
|
strategy:
|
|
matrix:
|
|
python-version: ['3.10', '3.11', '3.12']
|
|
node-version: ['18.x']
|
|
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@v4
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Install Yarn Package Manager
|
|
run: npm install -g yarn
|
|
|
|
- name: Setup Node.js with Yarn Caching
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: yarn
|
|
cache-dependency-path: netbox/project-static/yarn.lock
|
|
|
|
- name: Install Frontend Dependencies
|
|
run: yarn --cwd netbox/project-static
|
|
|
|
- name: Install dependencies & set up configuration
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
pip install ruff coverage tblib
|
|
|
|
- name: Build documentation
|
|
run: mkdocs build
|
|
|
|
- name: Collect static files
|
|
run: python netbox/manage.py collectstatic --no-input
|
|
|
|
- name: Check for missing migrations
|
|
run: python netbox/manage.py makemigrations --check
|
|
|
|
- name: Check PEP8 compliance
|
|
run: ruff check netbox/
|
|
|
|
- name: Check UI ESLint, TypeScript, and Prettier Compliance
|
|
run: yarn --cwd netbox/project-static validate
|
|
|
|
- name: Validate Static Asset Integrity
|
|
run: scripts/verify-bundles.sh
|
|
|
|
- name: Run tests
|
|
run: coverage run --source="netbox/" netbox/manage.py test netbox/ --parallel
|
|
|
|
- name: Show coverage report
|
|
run: coverage report --skip-covered --omit '*/migrations/*,*/tests/*'
|