Skip to content

Test with all supported NetBox versions #1182

Test with all supported NetBox versions

Test with all supported NetBox versions #1182

Workflow file for this run

name: Test
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
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 repo
uses: actions/checkout@v2
with:
path: netbox-dns
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Checkout netbox
uses: actions/checkout@v2
with:
repository: "netbox-community/netbox"
path: netbox
- name: install netbox_dns
working-directory: netbox-dns
run: |
# include tests directory for test
sed -i 's/exclude/#exclude/g' pyproject.toml
pip install .
- name: Install dependencies & set up configuration
working-directory: netbox
run: |
ln -s $(pwd)/../netbox-dns/media/configuration.testing.py netbox/netbox/configuration.py
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
working-directory: netbox
run: |
python netbox/manage.py test netbox_dns.tests -v 2