-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from CM000n/enhancement/add_version_check_to_g…
…ithub_workflows Enhancement/add version check to GitHub workflows
- Loading branch information
Showing
4 changed files
with
59 additions
and
2 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
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 |
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 |
---|---|---|
|
@@ -12,5 +12,5 @@ | |
"questdb>=1.0,<2.0", | ||
"tenacity>=8.0" | ||
], | ||
"version": "v0.0.7" | ||
"version": "v0.0.9" | ||
} |
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