Merge pull request #159 from SaaShup/add_refresh_host_operation #87
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: main branch CI | |
on: | |
push: | |
branches: | |
- "main_3x" | |
jobs: | |
testing: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.11"] | |
netbox-version: ["v3.6.9","v3.7.8"] | |
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 | |
uses: actions/checkout@v3 | |
with: | |
path: netbox-docker-plugin | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Checkout netbox ${{ matrix.netbox-version }} | |
uses: actions/checkout@v3 | |
with: | |
repository: "netbox-community/netbox" | |
ref: ${{ matrix.netbox-version }} | |
path: netbox | |
- name: Install netbox_docker_plugin Dependencies | |
working-directory: netbox-docker-plugin | |
run: | | |
pip install . | |
pip install requests_mock | |
- name: Install netbox Dependencies | |
working-directory: netbox | |
run: | | |
ln -s $(pwd)/../netbox-docker-plugin/netbox_configuration/configuration_testing.py netbox/netbox/configuration.py | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt -U | |
- name: Run Pylint | |
run: | | |
pip install pylint | |
pylint --rcfile $(pwd)/netbox-docker-plugin/.pylintrc --init-hook 'import os; import sys; sys.path.append(os.getcwd() + "/netbox/netbox")' $(pwd)/netbox-docker-plugin/netbox_docker_plugin/ | |
- name: Run tests | |
working-directory: netbox | |
run: | | |
netbox/manage.py test netbox_docker_plugin.tests -v 2 |