| 1 |
name: main |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- main |
| 7 |
tags: |
| 8 |
- "*" |
| 9 |
|
| 10 |
pull_request: |
| 11 |
branches: |
| 12 |
- main |
| 13 |
|
| 14 |
jobs: |
| 15 |
build: |
| 16 |
runs-on: ${{ matrix.os }} |
| 17 |
|
| 18 |
strategy: |
| 19 |
fail-fast: false |
| 20 |
matrix: |
| 21 |
name: [ |
| 22 |
"windows-py38", |
| 23 |
"windows-py311", |
| 24 |
"windows-pypy3", |
| 25 |
|
| 26 |
"ubuntu-py38-pytestmain", |
| 27 |
"ubuntu-py38", |
| 28 |
"ubuntu-py39", |
| 29 |
"ubuntu-py310", |
| 30 |
"ubuntu-py311", |
| 31 |
"ubuntu-py312", |
| 32 |
"ubuntu-pypy3", |
| 33 |
"ubuntu-benchmark", |
| 34 |
] |
| 35 |
|
| 36 |
include: |
| 37 |
- name: "windows-py38" |
| 38 |
python: "3.8" |
| 39 |
os: windows-latest |
| 40 |
tox_env: "py38" |
| 41 |
- name: "windows-py311" |
| 42 |
python: "3.10" |
| 43 |
os: windows-latest |
| 44 |
tox_env: "py311" |
| 45 |
- name: "windows-pypy3" |
| 46 |
python: "pypy3.9" |
| 47 |
os: windows-latest |
| 48 |
tox_env: "pypy3" |
| 49 |
- name: "ubuntu-py38" |
| 50 |
python: "3.8" |
| 51 |
os: ubuntu-latest |
| 52 |
tox_env: "py38" |
| 53 |
use_coverage: true |
| 54 |
- name: "ubuntu-py38-pytestmain" |
| 55 |
python: "3.8" |
| 56 |
os: ubuntu-latest |
| 57 |
tox_env: "py38-pytestmain" |
| 58 |
use_coverage: true |
| 59 |
- name: "ubuntu-py39" |
| 60 |
python: "3.9" |
| 61 |
os: ubuntu-latest |
| 62 |
tox_env: "py39" |
| 63 |
use_coverage: true |
| 64 |
- name: "ubuntu-py310" |
| 65 |
python: "3.10" |
| 66 |
os: ubuntu-latest |
| 67 |
tox_env: "py310" |
| 68 |
- name: "ubuntu-py311" |
| 69 |
python: "3.11" |
| 70 |
os: ubuntu-latest |
| 71 |
tox_env: "py311" |
| 72 |
use_coverage: true |
| 73 |
- name: "ubuntu-py312" |
| 74 |
python: "3.12-dev" |
| 75 |
os: ubuntu-latest |
| 76 |
tox_env: "py312" |
| 77 |
use_coverage: true |
| 78 |
- name: "ubuntu-pypy3" |
| 79 |
python: "pypy3.9" |
| 80 |
os: ubuntu-latest |
| 81 |
tox_env: "pypy3" |
| 82 |
use_coverage: true |
| 83 |
- name: "ubuntu-benchmark" |
| 84 |
python: "3.8" |
| 85 |
os: ubuntu-latest |
| 86 |
tox_env: "benchmark" |
| 87 |
|
| 88 |
steps: |
| 89 |
- uses: actions/checkout@v3 |
| 90 |
with: |
| 91 |
fetch-depth: 0 |
| 92 |
|
| 93 |
- name: Set up Python ${{ matrix.python }} |
| 94 |
uses: actions/setup-python@v4 |
| 95 |
with: |
| 96 |
python-version: ${{ matrix.python }} |
| 97 |
|
| 98 |
- name: Install dependencies |
| 99 |
run: | |
| 100 |
python -m pip install --upgrade pip setuptools |
| 101 |
python -m pip install tox coverage |
| 102 |
|
| 103 |
- name: Test without coverage |
| 104 |
if: "! matrix.use_coverage" |
| 105 |
run: "tox -e ${{ matrix.tox_env }}" |
| 106 |
|
| 107 |
- name: Test with coverage |
| 108 |
if: "matrix.use_coverage" |
| 109 |
run: "tox -e ${{ matrix.tox_env }}-coverage" |
| 110 |
|
| 111 |
- name: Upload coverage |
| 112 |
if: matrix.use_coverage && github.repository == 'pytest-dev/pluggy' |
| 113 |
uses: codecov/codecov-action@v4 |
| 114 |
continue-on-error: true |
| 115 |
with: |
| 116 |
fail_ci_if_error: true |
| 117 |
files: ./coverage.xml |
| 118 |
verbose: true |
| 119 |
|
| 120 |
deploy: |
| 121 |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pluggy' |
| 122 |
runs-on: ubuntu-latest |
| 123 |
|
| 124 |
steps: |
| 125 |
- uses: actions/checkout@v3 |
| 126 |
with: |
| 127 |
fetch-depth: 0 |
| 128 |
|
| 129 |
- uses: actions/setup-python@v4 |
| 130 |
with: |
| 131 |
python-version: "3.11" |
| 132 |
|
| 133 |
- name: Install dependencies |
| 134 |
run: | |
| 135 |
python -m pip install --upgrade pip |
| 136 |
pip install --upgrade build |
| 137 |
|
| 138 |
- name: Build package |
| 139 |
run: python -m build --sdist --wheel --outdir dist/ |
| 140 |
|
| 141 |
- name: Publish package |
| 142 |
uses: pypa/[email protected] |
| 143 |
with: |
| 144 |
user: __token__ |
| 145 |
password: ${{ secrets.pypi_token }} |