Skip to content

fix migrations

fix migrations #462

Workflow file for this run

name: CI
on:
push:
branches: ["**"]
tags-ignore: ["**"]
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Run pre-commit checks
uses: pre-commit/[email protected]
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
netbox_version: [v3.7.8, v4.0.11, v4.1.3]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build NetBox
uses: ./.github/build_netbox
with:
netbox_version: ${{ matrix.netbox_version }}
- name: Run Tests
id: run_tests
run: >-
set -o pipefail
&& cd development
&& docker compose run netbox sh -c "cd /plugin/validity && pytest --cov"
| tee /dev/stderr | grep -oP '(?<=Total coverage:\s)[0-9.]+'
| awk '{print "cov="$1}' > $GITHUB_OUTPUT
- name: Create Coverage Badge
if: github.ref == 'refs/heads/master'
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: 9e518ae8babd18b7edd8ee5aad58146b
filename: cov.json
label: Coverage
message: ${{ fromJSON(steps.run_tests.outputs.cov) }}%
valColorRange: ${{ fromJSON(steps.run_tests.outputs.cov) }}
maxColorRange: 90
minColorRange: 50
test_migrations:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
netbox_version: [v3.7.8, v4.0.11, v4.1.3]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build NetBox
uses: ./.github/build_netbox
with:
netbox_version: ${{ matrix.netbox_version }}
- name: Check missed migrations
run: cd development && docker compose run netbox sh -c "./manage.py makemigrations --check --dry-run"
- name: Check migrations run
run: cd development && docker compose run netbox sh -c "./manage.py migrate"