Skip to content

Commit

Permalink
Merge pull request #15 from ZPascal/add-more-sample-dashboards
Browse files Browse the repository at this point in the history
feat: Add more sample dashboards and adjust the documentation
  • Loading branch information
ZPascal authored Oct 7, 2023
2 parents 06db94c + ce81efd commit aad54b7
Show file tree
Hide file tree
Showing 7 changed files with 5,513 additions and 75 deletions.
70 changes: 57 additions & 13 deletions .github/workflows/pull-request-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
python-version: [ '3.x' ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand All @@ -35,10 +35,10 @@ jobs:
python-version: [ '3.x' ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand All @@ -48,7 +48,7 @@ jobs:
run: pip install -r requirements.txt

- name: Execute the linting checks
uses: reviewdog/action-flake8@v3.2.0
uses: reviewdog/action-flake8@v3.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
flake8_args: --config=.flake8
Expand All @@ -60,13 +60,13 @@ jobs:
python-version: [ '3.x' ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand All @@ -79,7 +79,7 @@ jobs:
run: export PYTHONPATH=$PWD && pytest --junitxml=pytest.xml --cov=. tests/ | tee pytest-coverage.txt

- name: Execute the coverage checks
uses: MishaKav/[email protected].16
uses: MishaKav/[email protected].48
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pytest-coverage-path: ./pytest-coverage.txt
Expand All @@ -90,11 +90,8 @@ jobs:
- name: Generate coverage badge
run: coverage-badge -f -o docs/coverage.svg

- name: Generate documentation
run: pydoc-markdown --render-toc && rm -rf docs/content && mv build/docs/* docs

- name: Check changed files
uses: tj-actions/verify-changed-files@v8.8
uses: tj-actions/verify-changed-files@v16
id: verify-changed-files
with:
files: |
Expand All @@ -106,7 +103,7 @@ jobs:
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add --force docs
git commit -m "Add coverage badge and documentation"
git commit -m "Add coverage badge"
- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
Expand All @@ -115,3 +112,50 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}
force: true

documentation:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9' ]

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'

- name: Install the requirements
run: pip install pydoc-markdown==4.6.3 mkdocs mkdocs-material

- name: Generate documentation
run: pydoc-markdown --render-toc && rm -rf docs/content && mv build/docs/* docs

- name: Check changed files
uses: tj-actions/verify-changed-files@v16
id: verify-changed-files
with:
files: |
docs
- name: Commit files
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add --force docs
git commit -m "docs: Add the documentation"
- name: Push changes
uses: ad-m/github-push-action@master
if: steps.verify-changed-files.outputs.files_changed == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Description

The Grafana dashboard templater create a valid Grafana dashboard as dictionary based on a template and injected values.
The Grafana dashboard templater create a valid Grafana dashboard as dictionary based on a template and injected values. You can find sample dashboards [here](./dashboard-templates/database), but note that you will need to adjust the appropriate settings for your own data sources.

## Dashboard template folder structure

Expand Down
Loading

0 comments on commit aad54b7

Please sign in to comment.