👷 support cross platform test

This commit is contained in:
yanyongyu 2022-01-13 17:58:35 +08:00
parent b52ccc3690
commit 88bd49de45
3 changed files with 23 additions and 8 deletions

View File

@ -1,12 +1,18 @@
name: Setup Python name: Setup Python
description: Setup Python description: Setup Python
inputs:
python-version:
description: Python version
required: false
default: "3.9"
runs: runs:
using: "composite" using: "composite"
steps: steps:
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
with: with:
python-version: "3.9" python-version: ${{ inputs.python-version }}
architecture: "x64" architecture: "x64"
- uses: Gr1N/setup-poetry@v7 - uses: Gr1N/setup-poetry@v7
@ -14,7 +20,7 @@ runs:
- uses: actions/cache@v2 - uses: actions/cache@v2
with: with:
path: ~/.cache/pypoetry/virtualenvs path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} key: ${{ runner.os }}-poetry-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- run: poetry install -E all - run: poetry install -E all
shell: bash shell: bash

View File

@ -6,13 +6,21 @@ on:
jobs: jobs:
test: test:
runs-on: ubuntu-latest
name: Run Pytest and Upload Coverage name: Run Pytest and Upload Coverage
strategy:
matrix:
python: ["pypy-3.7", "3.7", "pypy-3.8", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Setup Python environment - name: Setup Python environment
uses: ./.github/actions/setup-python uses: ./.github/actions/setup-python
with:
python-version: ${{ matrix.python }}
- name: Run Pytest - name: Run Pytest
run: | run: |

11
poetry.lock generated
View File

@ -63,7 +63,7 @@ python-versions = "*"
[[package]] [[package]]
name = "anyio" name = "anyio"
version = "3.4.0" version = "3.5.0"
description = "High level compatibility layer for multiple asynchronous event loop implementations" description = "High level compatibility layer for multiple asynchronous event loop implementations"
category = "main" category = "main"
optional = false optional = false
@ -75,7 +75,7 @@ sniffio = ">=1.1"
typing-extensions = {version = "*", markers = "python_version < \"3.8\""} typing-extensions = {version = "*", markers = "python_version < \"3.8\""}
[package.extras] [package.extras]
doc = ["sphinx-rtd-theme", "sphinx-autodoc-typehints (>=1.2.0)"] doc = ["packaging", "sphinx-rtd-theme", "sphinx-autodoc-typehints (>=1.2.0)"]
test = ["coverage[toml] (>=4.5)", "hypothesis (>=4.0)", "pytest (>=6.0)", "pytest-mock (>=3.6.1)", "trustme", "contextlib2", "uvloop (<0.15)", "mock (>=4)", "uvloop (>=0.15)"] test = ["coverage[toml] (>=4.5)", "hypothesis (>=4.0)", "pytest (>=6.0)", "pytest-mock (>=3.6.1)", "trustme", "contextlib2", "uvloop (<0.15)", "mock (>=4)", "uvloop (>=0.15)"]
trio = ["trio (>=0.16)"] trio = ["trio (>=0.16)"]
@ -561,12 +561,13 @@ async-asgi-testclient = "^1.4.8"
nonebot2 = "^2.0.0-beta.1" nonebot2 = "^2.0.0-beta.1"
pytest = "^6.2.5" pytest = "^6.2.5"
pytest-asyncio = "^0.16.0" pytest-asyncio = "^0.16.0"
typing-extensions = "^4.0.0"
[package.source] [package.source]
type = "git" type = "git"
url = "https://github.com/nonebot/nonebug.git" url = "https://github.com/nonebot/nonebug.git"
reference = "master" reference = "master"
resolved_reference = "123916d7281a49e45a1e6b7472a682bec16290ac" resolved_reference = "5556f94f3e85a26602fc015013e9fbdda07f8c71"
[[package]] [[package]]
name = "packaging" name = "packaging"
@ -1319,8 +1320,8 @@ alabaster = [
{file = "alabaster-0.7.12.tar.gz", hash = "sha256:a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02"}, {file = "alabaster-0.7.12.tar.gz", hash = "sha256:a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02"},
] ]
anyio = [ anyio = [
{file = "anyio-3.4.0-py3-none-any.whl", hash = "sha256:2855a9423524abcdd652d942f8932fda1735210f77a6b392eafd9ff34d3fe020"}, {file = "anyio-3.5.0-py3-none-any.whl", hash = "sha256:b5fa16c5ff93fa1046f2eeb5bbff2dad4d3514d6cda61d02816dba34fa8c3c2e"},
{file = "anyio-3.4.0.tar.gz", hash = "sha256:24adc69309fb5779bc1e06158e143e0b6d2c56b302a3ac3de3083c705a6ed39d"}, {file = "anyio-3.5.0.tar.gz", hash = "sha256:a0aeffe2fb1fdf374a8e4b471444f0f3ac4fb9f5a5b542b48824475e0042a5a6"},
] ]
asgiref = [ asgiref = [
{file = "asgiref-3.4.1-py3-none-any.whl", hash = "sha256:ffc141aa908e6f175673e7b1b3b7af4fdb0ecb738fc5c8b88f69f055c2415214"}, {file = "asgiref-3.4.1-py3-none-any.whl", hash = "sha256:ffc141aa908e6f175673e7b1b3b7af4fdb0ecb738fc5c8b88f69f055c2415214"},