Skip to content

Feature: 支持获取背景图 #78

Feature: 支持获取背景图

Feature: 支持获取背景图 #78

Workflow file for this run

name: Code Coverage
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test Coverage
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.11", "3.12"]
db: ["sqlite+aiosqlite://"]
db-pool: ["StaticPool"]
include:
- os: ubuntu-latest
python-version: "3.10"
db: sqlite+aiosqlite://
db-pool: StaticPool
- os: ubuntu-latest
python-version: "3.10"
db: postgresql+asyncpg://postgres:postgres@localhost:5432/postgres
db-pool: NullPool
- os: ubuntu-latest
python-version: "3.10"
db: mysql+aiomysql://mysql:mysql@localhost:3306/mymysql
db-pool: NullPool
- os: windows-latest
python-version: "3.10"
db: sqlite+aiosqlite://
db-pool: StaticPool
- os: macos-13
python-version: "3.10"
arch: x64
db: sqlite+aiosqlite://
db-pool: StaticPool
fail-fast: false
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
SQLALCHEMY_DATABASE_URL: ${{ matrix.db }}
SQLALCHEMY_POOL_CLASS: ${{ matrix.db-pool }}
services:
postgresql:
image: ${{ startsWith(matrix.db, 'postgresql') && 'postgres' || '' }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
mysql:
image: ${{ startsWith(matrix.db, 'mysql') && 'mysql' || '' }}
env:
MYSQL_ROOT_PASSWORD: mysql
MYSQL_USER: mysql
MYSQL_PASSWORD: mysql
MYSQL_DATABASE: mymysql
ports:
- 3306:3306
steps:
- uses: actions/checkout@v4
- name: Setup Python environment
uses: ./.github/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Run migrations
run: pdm run nb orm upgrade
- name: Run tests
shell: bash
run: |
sed -ie "s#sqlite+aiosqlite://#${SQLALCHEMY_DATABASE_URL}#g" tests/conftest.py
sed -ie "s#StaticPool#${SQLALCHEMY_POOL_CLASS}#g" tests/conftest.py
pdm test_single
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON_VERSION,SQLALCHEMY_DATABASE_URL,SQLALCHEMY_POOL_CLASS