From 22b870bea646ca539a5f0f83167cf9a1e44f9cec Mon Sep 17 00:00:00 2001 From: hemengyang Date: Wed, 18 May 2022 10:08:35 +0000 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=B8=8E=E8=A6=86=E7=9B=96=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codecov.yml | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/codecov.yml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 0000000..ecab769 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,40 @@ +name: Code Coverage + +on: + push: + branches: + - main + pull_request: + +jobs: + test: + name: Test Coverage + runs-on: ${{ matrix.os }} + concurrency: + group: test-coverage-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }} + cancel-in-progress: true + strategy: + matrix: + python-version: ["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@v3 + + - name: Setup Python environment + uses: he0119/setup-python@v0.1.0 + with: + python-version: ${{ matrix.python-version }} + + - name: Run Pytest + run: poetry run pytest --cov-report xml --cov=./src/plugins/nonebot_bison -k 'not compare and not render' + - name: Upload coverage report + uses: codecov/codecov-action@v3 + with: + env_vars: OS,PYTHON_VERSION + files: ./tests/coverage.xml + flags: unittests