Updating the filter expression description for the tools #30
Workflow file for this run
This file contains hidden or 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
--- | |
name: Test | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
- feature/** | |
- release/** | |
- hotfix/** | |
paths: | |
- pyproject.toml | |
- Dockerfile | |
- '*.py' | |
- tests/** | |
- tools/** | |
- utils/** | |
pull_request: | |
paths: | |
- pyproject.toml | |
- Dockerfile | |
- '*.py' | |
- tests/** | |
- tools/** | |
- utils/** | |
workflow_call: | |
concurrency: | |
group: '${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read # required for actions/checkout | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
version: "0.7.17" | |
- name: Download dependencies | |
run: make init | |
- name: Run ruff | |
run: make lint | |
- name: Run Unit Tests | |
run: make test | |
pre_release: | |
name: Tag Release | |
runs-on: ubuntu-latest | |
needs: test | |
permissions: | |
contents: write # required for creating a tag | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.sha }} # required for better experience using pre-releases | |
fetch-depth: '0' # Required due to the way Git works, without it this action won't be able to find any or the correct tags | |
- name: Extract current version | |
id: pyproject_version | |
run: | | |
TAG=v$(grep 'version =' pyproject.toml | sed -e 's/version = "\(.*\)"/\1/') | |
echo "TAG=$TAG" >> "$GITHUB_OUTPUT" | |
- name: Get tag version | |
id: semantic_release | |
uses: anothrNick/github-tag-action@1.71.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DEFAULT_BUMP: "patch" | |
TAG_CONTEXT: 'repo' | |
WITH_V: true | |
PRERELEASE_SUFFIX: "beta" | |
PRERELEASE: ${{ (github.base_ref != 'main') && 'true' || 'false' }} | |
DRY_RUN: true | |
- name: Compare versions | |
run: | | |
echo "Current version: ${{ steps.pyproject_version.outputs.TAG }}" | |
echo "New version: ${{ steps.semantic_release.outputs.tag }}" | |
if [ "${{ steps.pyproject_version.outputs.TAG }}" != "${{ steps.semantic_release.outputs.tag }}" ]; then | |
echo "### Version mismatch detected! :warning: | |
Current pyproject version: ${{ steps.pyproject_version.outputs.TAG }} | |
New Tag version: **${{ steps.semantic_release.outputs.tag }}** | |
Current Tag: ${{ steps.semantic_release.outputs.old_tag }} | |
Please update the version in pyproject.toml." >> $GITHUB_STEP_SUMMARY | |
exit 1 | |
else | |
echo "### Version match confirmed! :rocket: | |
Current pyproject version: ${{ steps.pyproject_version.outputs.TAG }} | |
New Tag version: **${{ steps.semantic_release.outputs.tag }}** | |
The version is up-to-date." >> $GITHUB_STEP_SUMMARY | |
fi |