Skip to content

Commit d519e83

Browse files
authored
Merge pull request #1 from netdevops/claude/design-hier-config-api-uft7J
Add comprehensive REST API for hier_config network configuration management
2 parents 25ed733 + ace3d02 commit d519e83

49 files changed

Lines changed: 8194 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.11"
20+
21+
- name: Install Poetry
22+
uses: snok/install-poetry@v1
23+
with:
24+
version: 2.3.1
25+
virtualenvs-create: true
26+
virtualenvs-in-project: true
27+
28+
- name: Load cached venv
29+
id: cached-poetry-dependencies
30+
uses: actions/cache@v4
31+
with:
32+
path: .venv
33+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
34+
35+
- name: Install dependencies
36+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
37+
run: poetry install --no-interaction --no-root
38+
39+
- name: Install project
40+
run: poetry install --no-interaction
41+
42+
- name: Run Ruff linter
43+
run: poetry run ruff check .
44+
45+
- name: Run Ruff formatter check
46+
run: poetry run ruff format --check .
47+
48+
- name: Run mypy
49+
run: poetry run mypy hier_config_api
50+
51+
test:
52+
name: Test (Python ${{ matrix.python-version }})
53+
runs-on: ubuntu-latest
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
python-version: ["3.10", "3.11", "3.12"]
58+
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- name: Set up Python ${{ matrix.python-version }}
63+
uses: actions/setup-python@v5
64+
with:
65+
python-version: ${{ matrix.python-version }}
66+
67+
- name: Install Poetry
68+
uses: snok/install-poetry@v1
69+
with:
70+
version: 2.3.1
71+
virtualenvs-create: true
72+
virtualenvs-in-project: true
73+
74+
- name: Load cached venv
75+
id: cached-poetry-dependencies
76+
uses: actions/cache@v4
77+
with:
78+
path: .venv
79+
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
80+
81+
- name: Install dependencies
82+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
83+
run: poetry install --no-interaction --no-root
84+
85+
- name: Install project
86+
run: poetry install --no-interaction
87+
88+
- name: Run tests
89+
run: poetry run pytest --cov=hier_config_api --cov-report=xml --cov-report=term-missing
90+
91+
- name: Upload coverage to Codecov
92+
uses: codecov/codecov-action@v4
93+
if: matrix.python-version == '3.11'
94+
with:
95+
file: ./coverage.xml
96+
fail_ci_if_error: false

.github/workflows/docs.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.11"
24+
25+
- name: Install Poetry
26+
uses: snok/install-poetry@v1
27+
with:
28+
version: 2.3.1
29+
virtualenvs-create: true
30+
virtualenvs-in-project: true
31+
32+
- name: Load cached venv
33+
id: cached-poetry-dependencies
34+
uses: actions/cache@v4
35+
with:
36+
path: .venv
37+
key: venv-docs-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
38+
39+
- name: Install dependencies
40+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
41+
run: poetry install --no-interaction --no-root
42+
43+
- name: Install project
44+
run: poetry install --no-interaction
45+
46+
- name: Build documentation
47+
run: poetry run mkdocs build
48+
49+
- name: Deploy to GitHub Pages
50+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
51+
uses: peaceiris/actions-gh-pages@v4
52+
with:
53+
github_token: ${{ secrets.GITHUB_TOKEN }}
54+
publish_dir: ./site

0 commit comments

Comments
 (0)