🔀 Merge pull request #686

Cross platform code coverage test
This commit is contained in:
Ju4tCode 2022-01-13 18:17:15 +08:00 committed by GitHub
commit 10395d6bce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 9 deletions

View File

@ -1,12 +1,18 @@
name: Setup Python
description: Setup Python
inputs:
python-version:
description: Python version
required: false
default: "3.9"
runs:
using: "composite"
steps:
- uses: actions/setup-python@v2
with:
python-version: "3.9"
python-version: ${{ inputs.python-version }}
architecture: "x64"
- uses: Gr1N/setup-poetry@v7
@ -14,7 +20,7 @@ runs:
- uses: actions/cache@v2
with:
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
shell: bash

View File

@ -6,13 +6,24 @@ on:
jobs:
test:
runs-on: ubuntu-latest
name: Run Pytest and Upload Coverage
name: Test Coverage
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Setup Python environment
uses: ./.github/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Run Pytest
run: |
@ -22,5 +33,6 @@ jobs:
- name: Upload coverage report
uses: codecov/codecov-action@v2
with:
env_vars: OS,PYTHON_VERSION
files: ./tests/coverage.xml
flags: unittests

11
poetry.lock generated
View File

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