test_ok2/.github/workflows/test.yml

214 lines
5.3 KiB
YAML
Raw Normal View History

name: test
on:
push:
branches:
- main
- "[0-9]+.[0-9]+.x"
2022-01-02 05:36:10 +08:00
- "test-me-*"
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
pull_request:
branches:
- main
- "[0-9]+.[0-9]+.x"
2021-05-04 23:42:13 +08:00
env:
PYTEST_ADDOPTS: "--color=yes"
# Cancel running jobs for the same workflow and branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Set permissions at the job level.
permissions: {}
jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v2.0.0
build:
needs: [package]
runs-on: ${{ matrix.os }}
timeout-minutes: 45
permissions:
contents: read
strategy:
fail-fast: false
matrix:
name: [
"windows-py38",
2023-07-01 06:19:19 +08:00
"windows-py38-pluggy",
2021-03-26 18:27:41 +08:00
"windows-py39",
"windows-py310",
"windows-py311",
2023-04-11 15:20:19 +08:00
"windows-py312",
"ubuntu-py38",
2023-07-01 06:19:19 +08:00
"ubuntu-py38-pluggy",
"ubuntu-py38-freeze",
2020-05-07 20:26:55 +08:00
"ubuntu-py39",
2021-03-26 18:27:41 +08:00
"ubuntu-py310",
"ubuntu-py311",
2023-04-11 15:20:19 +08:00
"ubuntu-py312",
"ubuntu-pypy3",
2023-07-01 06:19:19 +08:00
"macos-py38",
"macos-py39",
"macos-py310",
2023-04-11 15:20:19 +08:00
"macos-py312",
"doctesting",
"plugins",
]
include:
- name: "windows-py38"
python: "3.8"
os: windows-latest
tox_env: "py38-unittestextras"
use_coverage: true
2023-07-01 06:19:19 +08:00
- name: "windows-py38-pluggy"
python: "3.8"
os: windows-latest
tox_env: "py38-pluggymain-pylib-xdist"
2021-03-26 18:27:41 +08:00
- name: "windows-py39"
python: "3.9"
os: windows-latest
tox_env: "py39-xdist"
- name: "windows-py310"
2022-02-11 19:49:11 +08:00
python: "3.10"
2021-03-26 18:27:41 +08:00
os: windows-latest
tox_env: "py310-xdist"
- name: "windows-py311"
2023-04-11 15:20:19 +08:00
python: "3.11"
os: windows-latest
tox_env: "py311"
2023-04-11 15:20:19 +08:00
- name: "windows-py312"
python: "3.12-dev"
os: windows-latest
tox_env: "py312"
- name: "ubuntu-py38"
python: "3.8"
os: ubuntu-latest
tox_env: "py38-lsof-numpy-pexpect"
use_coverage: true
2023-07-01 06:19:19 +08:00
- name: "ubuntu-py38-pluggy"
python: "3.8"
os: ubuntu-latest
tox_env: "py38-pluggymain-pylib-xdist"
- name: "ubuntu-py38-freeze"
python: "3.8"
os: ubuntu-latest
tox_env: "py38-freeze"
2020-05-07 20:26:55 +08:00
- name: "ubuntu-py39"
2020-11-01 04:16:07 +08:00
python: "3.9"
2020-05-07 20:26:55 +08:00
os: ubuntu-latest
tox_env: "py39-xdist"
2021-03-26 18:27:41 +08:00
- name: "ubuntu-py310"
2022-02-11 19:49:11 +08:00
python: "3.10"
2021-03-26 18:27:41 +08:00
os: ubuntu-latest
tox_env: "py310-xdist"
- name: "ubuntu-py311"
2023-04-11 15:20:19 +08:00
python: "3.11"
os: ubuntu-latest
tox_env: "py311"
fallback to native traceback when handling ExceptionGroup (take 2) [SQUASH] (#10209) * Squashed commit of the following: commit 41d339c46763bbe26123e1e6504b6e32290e33e1 Author: Cheukting <cheukting.ho@gmail.com> Date: Thu Jun 23 17:01:04 2022 +0800 test in all py versions commit b3572a5a12672228c3276fc8c8e05980dfb7888a Author: Cheukting <cheukting.ho@gmail.com> Date: Thu Jun 23 16:41:06 2022 +0800 add test commit 7166a2a51e4f99046b028b663c193d8b558c7fd4 Author: Cheukting <cheukting.ho@gmail.com> Date: Thu Jun 23 16:00:07 2022 +0800 update changelog commit b958c73d489157f0c0d4e46425083a5e2e2bc851 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu Jun 23 07:50:52 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit ea7f376c6ca37c40c83df0e4a1cfaaedb34bae91 Author: Cheukting <cheukting.ho@gmail.com> Date: Thu Jun 23 15:48:21 2022 +0800 Fix MyPy commit 97469beb1da40257e9a061a5e19548546c9312c4 Author: Cheukting <cheukting.ho@gmail.com> Date: Thu Jun 23 15:03:48 2022 +0800 fix if ExceptionGroup not exist commit 84e553642cd69b4d499231d733df91ebfa84c7ad Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu Jun 23 03:43:27 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 76bbef449b88bbd74fb5cca3b5293337a624ef03 Author: Cheukting <cheukting.ho@gmail.com> Date: Thu Jun 23 11:40:41 2022 +0800 adding changelog commit db82bebc5a4969e2083adcd97bdfd2a63bb17d98 Author: Cheukting <cheukting.ho@gmail.com> Date: Thu Jun 23 11:33:10 2022 +0800 fall back to native when handeling to exception groups * Typed ExceptionGroupTypes and changed to BaseExceptionGroup, fixed exceptionchain (excinfo->excinfo_, set reprcrash. Extended tests, though they're wip. * added exceptiongroup to pre-commit-config, moved away from tuple to directly defining BaseExceptionGroup, added block comment, added match line for inner exception, changked mark.skipif to importorskip to not need top-level import, changed tox.ini a bit - only uncovered should now be py37 without exceptiongroup, due to hypothesis * added py311-exceptiongroup to github CI, exceptiongroup is now a hard dependency on py<3.11, renamed bad variable names * added use_coverage to ubuntu-py311 * import BaseExceptionGroup with explicit version check instead of try/catch * removed from CI, added comments to tox and pre-commit
2022-08-18 00:16:32 +08:00
use_coverage: true
2023-04-11 15:20:19 +08:00
- name: "ubuntu-py312"
python: "3.12-dev"
os: ubuntu-latest
tox_env: "py312"
use_coverage: true
- name: "ubuntu-pypy3"
2023-07-01 06:19:19 +08:00
python: "pypy-3.8"
os: ubuntu-latest
tox_env: "pypy3-xdist"
2023-07-01 06:19:19 +08:00
- name: "macos-py38"
python: "3.8"
os: macos-latest
2023-07-01 06:19:19 +08:00
tox_env: "py38-xdist"
- name: "macos-py39"
python: "3.9"
os: macos-latest
tox_env: "py39-xdist"
2023-04-11 15:20:19 +08:00
use_coverage: true
- name: "macos-py310"
python: "3.10"
os: macos-latest
tox_env: "py310-xdist"
2023-04-11 15:20:19 +08:00
- name: "macos-py312"
python: "3.12-dev"
os: macos-latest
tox_env: "py312-xdist"
- name: "plugins"
python: "3.12"
os: ubuntu-latest
tox_env: "plugins"
- name: "doctesting"
2023-07-01 06:19:19 +08:00
python: "3.8"
os: ubuntu-latest
tox_env: "doctesting"
use_coverage: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Download Package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
check-latest: ${{ endsWith(matrix.python, '-dev') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox coverage
- name: Test without coverage
if: "! matrix.use_coverage"
shell: bash
run: tox run -e ${{ matrix.tox_env }} --installpkg `find dist/*.tar.gz`
- name: Test with coverage
if: "matrix.use_coverage"
shell: bash
run: tox run -e ${{ matrix.tox_env }}-coverage --installpkg `find dist/*.tar.gz`
- name: Generate coverage report
if: "matrix.use_coverage"
run: python -m coverage xml
- name: Upload coverage to Codecov
if: "matrix.use_coverage"
2022-10-09 20:27:35 +08:00
uses: codecov/codecov-action@v3
2022-10-22 01:11:43 +08:00
continue-on-error: true
with:
fail_ci_if_error: true
files: ./coverage.xml
verbose: true