Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement/add version check to GitHub workflows #17

Merged
merged 12 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/check-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Check versions

on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- created

jobs:
check-versions:
name: Check-versions
strategy:
matrix:
python-version: [3.11]
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4
- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: ⚙️ Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.5.1
- name: ⚙️ Install dependencies
run: poetry install
- name: 🚀 Check Manifest.json
run: |
pyproject_version=$(poetry version | awk '{print $2}')
echo "pyproject.toml version: $pyproject_version"
manifest_version=$(jq -r '.version' custom_components/qss/manifest.json)
echo "manifest.json version: $manifest_version"
if [[ "$pyproject_version" != "$manifest_version" ]]; then
echo "Error: Version mismatch between pyproject.toml ($pyproject_version) and manifest.json ($manifest_version)"
exit 1
fi

pyproject_dependencies=$(poetry show --only main | awk -F' ' '{print $1}')
echo "pyproject.toml dependecies: \n$pyproject_dependencies"
manifest_dependencies=$(jq -r '.requirements[]' custom_components/qss/manifest.json)
echo "manifest.json dependecies: \n$manifest_dependencies"
for dependency in $pyproject_dependencies; do
matching_dependency=$(echo "$manifest_dependencies" | grep "$dependency")
if [[ -z "$matching_dependency" ]]; then
echo "Error: Missing dependency $dependency in manifest.json"
exit 1
fi
done
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ repos:
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- id: no-commit-to-branch
args: [--branch, master, --branch, main]
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.2
hooks:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/qss/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"questdb>=1.0,<2.0",
"tenacity>=8.0"
],
"version": "v0.0.7"
"version": "v0.0.9"
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "qss"
version = "v0.0.8"
version = "v0.0.9"
description = "QuestDB State Storage (QSS) for Home Assistant"
license = "MIT"
readme = "README.md"
Expand Down
Loading