|
| 1 | +name: Smoke Test |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize, reopened] |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + |
| 10 | +jobs: |
| 11 | + smoke-test: |
| 12 | + name: Smoke test (${{ matrix.os }}, Python ${{ matrix.python-version }}) |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + env: |
| 15 | + PYTHONPATH: ${{ github.workspace }}/.. |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + os: [ubuntu-latest, windows-latest] |
| 20 | + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 21 | + steps: |
| 22 | + - name: Checkout repository |
| 23 | + uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - name: Expose legacy package import path |
| 26 | + if: runner.os != 'Windows' |
| 27 | + run: ln -sfn "$GITHUB_WORKSPACE" "$(dirname "$GITHUB_WORKSPACE")/self_learning_EterU" |
| 28 | + |
| 29 | + - name: Expose legacy package import path on Windows |
| 30 | + if: runner.os == 'Windows' |
| 31 | + shell: pwsh |
| 32 | + run: | |
| 33 | + $aliasPath = Join-Path (Split-Path $env:GITHUB_WORKSPACE -Parent) "self_learning_EterU" |
| 34 | + if (-not (Test-Path $aliasPath)) { |
| 35 | + New-Item -ItemType Junction -Path $aliasPath -Target $env:GITHUB_WORKSPACE | Out-Null |
| 36 | + } |
| 37 | +
|
| 38 | + - name: Set up Python |
| 39 | + uses: actions/setup-python@v5 |
| 40 | + with: |
| 41 | + python-version: ${{ matrix.python-version }} |
| 42 | + cache: pip |
| 43 | + cache-dependency-path: requirements-test.txt |
| 44 | + |
| 45 | + - name: Install smoke test dependencies |
| 46 | + if: matrix.python-version != '3.14' |
| 47 | + run: | |
| 48 | + python -m pip install --upgrade pip |
| 49 | + python -m pip install -r requirements-test.txt |
| 50 | + python -m pip install "astrbot>=4.14,<4.15" aiohttp "emoji==2.14.1" "hypercorn==0.17.3" jieba quart "quart_cors==0.8.0" pydantic "sqlalchemy[asyncio]" aiosqlite asyncpg "cachetools>=5.3.0" apscheduler "defusedxml>=0.7.1" |
| 51 | +
|
| 52 | + - name: Install smoke test dependencies for Python 3.14 |
| 53 | + if: matrix.python-version == '3.14' |
| 54 | + run: | |
| 55 | + python -m pip install --upgrade pip |
| 56 | + python -m pip install -r requirements-test.txt |
| 57 | + python -m pip install "astrbot>=4.24,<5" aiohttp "emoji==2.14.1" "hypercorn==0.17.3" jieba quart "quart_cors==0.8.0" pydantic "sqlalchemy[asyncio]" aiosqlite asyncpg "cachetools>=5.3.0" apscheduler "defusedxml>=0.7.1" |
| 58 | +
|
| 59 | + - name: Compile Python files |
| 60 | + run: python -m compileall . |
| 61 | + |
| 62 | + - name: Run smoke tests |
| 63 | + run: python -m pytest tests/integration/test_package_imports.py tests/integration/test_webui_static_assets.py --no-cov |
0 commit comments