Skip to content

Merge pull request #607 from netboxlabs/release/v0.6.0 #2215

Merge pull request #607 from netboxlabs/release/v0.6.0

Merge pull request #607 from netboxlabs/release/v0.6.0 #2215

Workflow file for this run

name: Lint and tests
on:
workflow_dispatch:
pull_request:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
checks: write
pull-requests: write
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install .[dev]
pip install .[test]
- name: Run ruff
run: ruff check
tests:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
netbox-ref: [ "main", "feature" ]
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: Checkout netbox-custom-objects
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: netbox-custom-objects
- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- name: Checkout netbox (${{ matrix.netbox-ref }})
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: "netbox-community/netbox"
path: netbox
ref: ${{ matrix.netbox-ref }}
- name: Install netbox-custom-objects
working-directory: netbox-custom-objects
run: |
# Include tests directory for test
sed -i 's/exclude-package-data/#exclude-package-data/g' pyproject.toml
python -m pip install --upgrade pip
pip install .
pip install .[test]
- name: Install dependencies & configure plugin
working-directory: netbox
run: |
ln -s $(pwd)/../netbox-custom-objects/testing/configuration.py netbox/netbox/configuration.py
python -m pip install --upgrade pip
pip install -r requirements.txt -U
- name: Run tests
working-directory: netbox
run: |
python netbox/manage.py test netbox_custom_objects.tests --keepdb