Skip to content

Commit

Permalink
Issue #141: adds jobs for validating version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
SonOfLope committed Aug 20, 2024
1 parent 8869e1d commit 6b2ffec
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/workflow-lint-test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name: Reusable lint and test workflow for Python projects

on:
workflow_call:
inputs:
pyproject-path:
required: false
type: string
package-name:
required: false
type: string

permissions:
actions: read
Expand Down Expand Up @@ -49,3 +56,35 @@ jobs:
- name: Run tests with coverage (coverage must be at least 80% to pass)
run: |
pytest --cov=. --cov-fail-under=80 tests/ # default value, coverage must be at least 80%
version-bump-check:
runs-on: ubuntu-latest

Check failure on line 61 in .github/workflows/workflow-lint-test-python.yml

View workflow job for this annotation

GitHub Actions / yaml-lint-check

61:7 [indentation] wrong indentation: expected 4 but found 6
if: inputs.pyproject-path != ''
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Parse version from pyproject.toml
id: parse_version
run: |
version=$(grep -Po '(?<=^version = ")[^"]*' ${{ inputs.pyproject-path }})
echo "version=$version" >> $GITHUB_ENV
- name: Get latest tag
id: get_latest_tag
run: |
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
- name: Check version bump
run: |
if [ "$version" == "$latest_tag" ]; then
echo "Version has not been bumped!"
exit 1
else
echo "Version has been bumped."
fi

0 comments on commit 6b2ffec

Please sign in to comment.