-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GitHub actions for new CI/CD checks and deployments
- Loading branch information
1 parent
b824839
commit 40f2571
Showing
11 changed files
with
238 additions
and
40 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Test the documentation build | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'docs/**' | ||
branches-ignore: | ||
- 'gh-pages' | ||
pull_request: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
check-documentation: | ||
name: Check documentation | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements_docs.txt | ||
- name: Check documentation build | ||
run: | | ||
mkdocs build --strict |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Check linting on push and pull request | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
branches-ignore: | ||
- 'gh-pages' | ||
pull_request: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
check-linting: | ||
name: Check linting | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install dependencies & set up configuration | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements_dev.txt | ||
- name: "Check code formatting with black" | ||
run: | | ||
black --check netbox_data_flows | ||
- name: "Check PEP8 compliance with Flake8" | ||
run: | | ||
flake8 --extend-ignore=D100,D101,D102,D103,D104,D105,D106,D107,D401 --max-line-length 120 netbox_data_flows | ||
- name: "Check import order" | ||
run: | | ||
isort --check netbox_data_flows | ||
- name: "Check manifest" | ||
run: | | ||
check-manifest |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Create documentation and publish it to GitHub pages | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
publish-documentation: | ||
name: Publish documentation | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements_docs.txt | ||
- name: Check documentation build | ||
run: | | ||
mkdocs build --strict | ||
- name: Publish documentation | ||
run: | | ||
mkdocs gh-deploy --force |
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
default_stages: [pre-commit] | ||
default_install_hook_types: [pre-commit, pre-push] | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: no-commit-to-branch | ||
- id: check-ast | ||
- id: check-toml | ||
- id: end-of-file-fixer | ||
stages: ["pre-commit"] | ||
- id: trailing-whitespace | ||
stages: ["pre-commit"] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 24.4.2 | ||
hooks: | ||
- id: black | ||
|
||
- repo: local | ||
hooks: | ||
- id: pyproject-flake8 | ||
name: pyproject-flake8 | ||
language: system | ||
pass_filenames: true | ||
entry: pflake8 | ||
types: ["python"] | ||
|
||
- repo: https://github.com/mgedmin/check-manifest | ||
rev: "0.49" | ||
hooks: | ||
- id: check-manifest | ||
|
||
- repo: local | ||
hooks: | ||
- id: check-missing-migrations | ||
name: check-missing-migrations | ||
entry: python /opt/netbox-dev/netbox/manage.py makemigrations netbox_data_flows --check | ||
language: system | ||
pass_filenames: false | ||
types: ["python"] | ||
stages: ["pre-push", "manual"] | ||
- id: check-pending-migrations | ||
name: check-pending-migrations | ||
entry: python /opt/netbox-dev/netbox/manage.py migrate netbox_data_flows --check | ||
language: system | ||
pass_filenames: false | ||
types: ["python"] | ||
stages: ["pre-push", "manual"] | ||
- id: run-tests | ||
name: run-tests | ||
entry: python /opt/netbox-dev/netbox/manage.py test --parallel auto netbox_data_flows | ||
language: system | ||
pass_filenames: false | ||
types: ["python"] | ||
stages: ["manual"] | ||
verbose: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
include *.md | ||
recursive-include netbox_data_flows/templates *.html | ||
recursive-include docs *.md *.png | ||
|
||
exclude .editorconfig .pre-commit-config.yaml | ||
exclude mkdocs.yml | ||
exclude requirements_dev.txt requirements_docs.txt |