Skip to content

Uv lint format

Uv lint format #546

Workflow file for this run

# This workflow will install the dependencies, run tests and lint every push
name: Python package
permissions:
checks: write
pull-requests: write
id-token: write
contents: read
on:
push:
branches: [ master ]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
env:
PYTHON: ${{ matrix.python-version }}
steps:
- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- uses: actions/checkout@v4
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install Poe
run: uv tool install poethepoet
- name: EtoE Test with pytest
env:
TEST_DATABASE: ${{ secrets.TEST_DATABASE }}
TEST_BLOB: ${{ secrets.TEST_BLOB }}
ENGINE_CONNECTION_STRING: ${{ secrets.ENGINE_CONNECTION_STRING }}
APPLICATION_INSIGHTS_ENGINE_CONNECTION_STRING: https://ade.applicationinsights.io/subscriptions/12534eb3-8109-4d84-83ad-576c0d5e1d06/resourcegroups/clients_e2e_test/providers/microsoft.insights/components/kusto-e2e-app-insights
APPLICATION_INSIGHTS_TEST_DATABASE: kusto-e2e-app-insights
run: poe test --ci
- name: "Run Ruff Formatter"
run: poe check-format
id: ruff-formatter
continue-on-error: true
- name: "Run Ruff Linter"
run: poe lint
id: ruff-linter
continue-on-error: true
- name: "Run Ruff Fixes"
id: fix-ruff
if: steps.ruff-formatter.outcome != 'success' || steps.ruff-linter.outcome != 'success'
run: poe fix
- uses: parkerbxyz/suggest-changes@v2
if: steps.fix-ruff.outcome == 'success' && matrix.python-version == '3.9'
with:
comment: 'Please commit the suggested changes from markdownlint.'
event: 'REQUEST_CHANGES'
- name: "Run Type Checking"
run: poe types
- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Unit Test Results (Python ${{ matrix.python-version }})
path: pytest*.xml
publish-test-results:
name: "Publish Unit Tests Results"
needs: build
runs-on: ubuntu-latest
if: always()
permissions:
checks: write
pull-requests: write
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: artifacts/**/*.xml