chore(main): release 2.2.0 #10
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
name: Python Test | |
on: | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
matrix: | |
platform: | |
- ubuntu-latest | |
- windows-latest | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
env: | |
DIRECTORY_TO_SCAN: ./ukrr_models | |
TODO_REGEX: 'TODO:(?!\s*\[[A-Za-z0-9-]+\])' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Poetry | |
uses: Gr1N/setup-poetry@v8 | |
- name: Set Up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies | |
run: poetry install | |
- name: Run Tox | |
run: poetry run tox | |
- name: TODO Check (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
result=$(find "$DIRECTORY_TO_SCAN" -type f -name "*.py" -exec grep -Hn -P "$TODO_REGEX" {} \;) | |
if [ -n "$result" ]; then | |
echo "Non-matching TODO comments found:" | |
echo "$result" | |
exit 1 | |
fi | |
- name: TODO Check (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
$result = Get-ChildItem -Path $env:DIRECTORY_TO_SCAN -Filter *.py -Recurse | ForEach-Object { Get-Content $_.FullName | Select-String -Pattern $env:TODO_REGEX } | |
if ($result) { | |
echo "Non-matching TODO comments found:" | |
echo "$result" | |
exit 1 | |
} |