Skip to content

Commit b545297

Browse files
committed
Simplify workflow
1 parent ec313d3 commit b545297

File tree

5 files changed

+60
-89
lines changed

5 files changed

+60
-89
lines changed

.github/workflows/ack.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/push.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,25 @@ jobs:
1414
env:
1515
FORCE_COLOR: 1
1616
PY_COLORS: 1
17-
TOXENV: pkg
1817

1918
steps:
20-
- name: Switch to using Python 3.9 by default
21-
uses: actions/setup-python@v4
22-
with:
23-
python-version: 3.9
24-
- name: Install tox
25-
run: python3 -m pip install --user "tox>=4.0.0"
26-
- name: Check out src from Git
27-
uses: actions/checkout@v3
28-
with:
29-
fetch-depth: 0 # needed by setuptools-scm
30-
- name: Build dists
31-
run: python -m tox
32-
- name: Publish to pypi.org
33-
if: >- # "create" workflows run separately from "push" & "pull_request"
34-
github.event_name == 'release'
35-
uses: pypa/gh-action-pypi-publish@release/v1
36-
with:
37-
password: ${{ secrets.pypi_password }}
19+
- uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0 # needed by setuptools-scm
22+
- name: Switch to using Python 3.9 by default
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: "3.9"
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install tox
30+
- name: Build dists
31+
run: |
32+
tox -e packaging
33+
- name: Publish to pypi.org
34+
if: >- # "create" workflows run separately from "push" & "pull_request"
35+
github.event_name == 'release'
36+
uses: pypa/gh-action-pypi-publish@release/v1
37+
with:
38+
password: ${{ secrets.pypi_password }}

.github/workflows/tox.yml

Lines changed: 39 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -19,61 +19,54 @@ concurrency:
1919
cancel-in-progress: true
2020

2121
jobs:
22-
pre:
23-
name: pre
24-
runs-on: ubuntu-22.04
25-
outputs:
26-
matrix: ${{ steps.generate_matrix.outputs.matrix }}
22+
lint:
23+
runs-on: ubuntu-latest
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
python-version: ["3.8", "3.9", "3.10", "3.11"]
2728
steps:
28-
- name: Determine matrix
29-
id: generate_matrix
30-
uses: coactions/matrix@main
31-
with:
32-
min_python: "3.8"
33-
max_python: "3.10"
34-
other_names: |
35-
lint
36-
docs
37-
packaging
29+
- uses: actions/checkout@v3
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install tox
38+
- name: Run tox -e lint
39+
run: |
40+
tox -e lint
3841
build:
39-
name: ${{ matrix.name }}
4042
runs-on: ubuntu-latest
41-
needs: pre
4243
strategy:
4344
fail-fast: false
44-
matrix: ${{ fromJson(needs.pre.outputs.matrix) }}
45+
matrix:
46+
toxenv: [docs, packaging, py39]
4547
steps:
46-
- uses: actions/checkout@v3
47-
with:
48-
fetch-depth: 0
49-
50-
# Even our lint and other envs need access to tox
51-
- name: Set up Python version
52-
uses: actions/setup-python@v4
53-
with:
54-
python-version: ${{ matrix.python_version }}
55-
56-
- name: Install dependencies
57-
run: |
58-
docker version
59-
docker info
60-
python -m pip install -U pip
61-
pip install tox
62-
- name: Run tox -e ${{ matrix.passed_name }}
63-
run: |
64-
echo "${{ matrix.PREFIX }} tox -e ${{ matrix.passed_name }}"
65-
${{ matrix.PREFIX }} tox -e ${{ matrix.passed_name }}
66-
48+
- uses: actions/checkout@v3
49+
- name: Set up Python 3.9
50+
uses: actions/setup-python@v4
51+
with:
52+
python-version: "3.9"
53+
- name: Install dependencies
54+
run: |
55+
python -m pip install --upgrade pip
56+
pip install tox
57+
- name: Run tox -e ${{ matrix.toxenv }}
58+
run: |
59+
tox -e ${{ matrix.toxenv }}
6760
check: # This job does nothing and is only used for the branch protection
6861
if: always()
6962
permissions:
7063
pull-requests: write # allow codenotify to comment on pull-request
7164
needs:
72-
- build
73-
runs-on: ubuntu-22.04
74-
65+
- lint
66+
- build
67+
runs-on: ubuntu-latest
7568
steps:
76-
- name: Decide whether the needed jobs succeeded or failed
77-
uses: re-actors/alls-green@release/v1
78-
with:
79-
jobs: ${{ toJSON(needs) }}
69+
- name: Decide whether the needed jobs succeeded or failed
70+
uses: re-actors/alls-green@release/v1
71+
with:
72+
jobs: ${{ toJSON(needs) }}

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ minversion = 4.0.16
33
envlist=
44
lint
55
py
6-
doc
6+
docs
77
packaging
88

99
[testenv]

0 commit comments

Comments
 (0)