Skip to content

chore: update readme and ci #31

chore: update readme and ci

chore: update readme and ci #31

Workflow file for this run

name: ci
on:
push:
branches-ignore:
- main
pull_request:
branches:
- main
env:
UV_SYSTEM_PYTHON: 1
jobs:
changed-files:
runs-on: ubuntu-latest
outputs:
workflow-changed: ${{ steps.changed-files.outputs.workflow_any_changed }}
pyproject-changed: ${{ steps.changed-files.outputs.pyproject_any_changed }}
src-changed: ${{ steps.changed-files.outputs.src_any_changed }}
tests-changed: ${{ steps.changed-files.outputs.tests_any_changed }}
docs-changed: ${{ steps.changed-files.outputs.doc_any_changed }}
steps:
- uses: actions/checkout@v4
- name: Get changed files by category
id: changed-files
uses: tj-actions/changed-files@v46
with:
files_yaml: |
workflow:
- .github/workflows/ci.yml
pyproject:
- pyproject.toml
- uv.lock
src:
- asyncodbc/**
- examples/*.py
tests:
- conftest.py
- tests/**
doc:
- CONTRIBUTING.rst
- README.rst
- docs/**
test:
runs-on: ubuntu-22.04
needs: changed-files
if: |
${{
(needs.changed-files.outputs.workflow-changed == 'true')
|| (needs.changed-files.outputs.pyproject-changed == 'true')
|| (needs.changed-files.outputs.src-changed == 'true')
|| (needs.changed-files.outputs.tests-changed == 'true')
}}
services:
mssql:
image: mcr.microsoft.com/mssql/server:2022-CU15-ubuntu-22.04
ports:
- 1433:1433
env:
ACCEPT_EULA: Y
SA_PASSWORD: Abcd12345678
options: >-
--health-cmd "/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P Abcd12345678 -Q 'SELECT 1' -b -o /dev/null"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
TEST_MSSQL_PASS: Abcd12345678
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install ODBC driver
run: |
curl -sSL -O https://packages.microsoft.com/config/ubuntu/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
activate-environment: true
- name: Install requirements
run: make deps
- name: Check style
run: make check
- name: Run tests
run: make testall
- name: Upload Coverage
run: uvx coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true
coveralls:
name: Finish Coveralls
needs: test
runs-on: ubuntu-22.04
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}