poller & command #196
Workflow file for this run
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: 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@v2 | |
with: | |
python-version: "3.10" | |
- name: Install dependecies | |
run: pip install -r requirements/dev.txt | |
- name: Run black | |
run: black --check --diff --color validity/ | |
- name: Run isort | |
run: isort --check --diff --color validity/ | |
- name: Run flake8 | |
run: flake8 validity/ | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
netbox_version: [v3.5.9, v3.6.5] | |
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: | |
matrix: | |
netbox_version: [v3.5.9, v3.6.5] | |
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" |