Skip to content

patch: Changing description of overall tools and fixed CI/CD workflows #31

patch: Changing description of overall tools and fixed CI/CD workflows

patch: Changing description of overall tools and fixed CI/CD workflows #31

Workflow file for this run

---
name: Test
on:
push:
branches:
- main
- beta
- integration
- feature/**
- release/**
- hotfix/**
paths:
- pyproject.toml
- Dockerfile
- '*.py'
- tests/**
- tools/**
- utils/**
pull_request:
paths:
- pyproject.toml
- Dockerfile
- '*.py'
- tests/**
- tools/**
- utils/**
workflow_call:
workflow_dispatch:
concurrency:
group: 'tests-${{ 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
check_version:
name: Check Version
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 == 'beta') && 'true' || (github.base_ref == 'main') && 'false' || (github.base_ref == 'integration') && 'false' || 'true' }}
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