Skip to content

Commit 66993ec

Browse files
committed
Split workflows into test and deploy
1 parent 2ffb426 commit 66993ec

File tree

3 files changed

+44
-34
lines changed

3 files changed

+44
-34
lines changed

.github/workflows/deploy.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: deploy
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
deploy:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
# Needed to fetch tags, which are required by setuptools-scm.
17+
fetch-depth: 0
18+
- name: Set up Python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: "3.10"
22+
- name: Install build
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install build
26+
- name: Build package
27+
run: |
28+
python -m build
29+
- name: Publish package to PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
with:
32+
user: __token__
33+
password: ${{ secrets.pypi_token }}

.github/workflows/main.yml renamed to .github/workflows/test.yml

+10-33
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
name: build
1+
name: test
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
8+
pull_request:
9+
branches:
10+
- "*"
411

512
jobs:
6-
build:
13+
test:
714

815
runs-on: ${{ matrix.os }}
916

@@ -52,33 +59,3 @@ jobs:
5259
- name: Test
5360
run: |
5461
tox -e ${{ matrix.tox_env }}
55-
56-
deploy:
57-
58-
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
59-
60-
runs-on: ubuntu-latest
61-
62-
needs: build
63-
64-
steps:
65-
- uses: actions/checkout@v3
66-
with:
67-
# Needed to fetch tags, which are required by setuptools-scm.
68-
fetch-depth: 0
69-
- name: Set up Python
70-
uses: actions/setup-python@v2
71-
with:
72-
python-version: "3.10"
73-
- name: Install wheel
74-
run: |
75-
python -m pip install --upgrade pip
76-
pip install build
77-
- name: Build package
78-
run: |
79-
python -m build
80-
- name: Publish package to PyPI
81-
uses: pypa/gh-action-pypi-publish@release/v1
82-
with:
83-
user: __token__
84-
password: ${{ secrets.pypi_token }}

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pytest-xdist
1313
:alt: Python versions
1414
:target: https://pypi.python.org/pypi/pytest-xdist
1515

16-
.. image:: https://github.com/pytest-dev/pytest-xdist/workflows/build/badge.svg
16+
.. image:: https://github.com/pytest-dev/pytest-xdist/workflows/test/badge.svg
1717
:target: https://github.com/pytest-dev/pytest-xdist/actions
1818

1919
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg

0 commit comments

Comments
 (0)