8000 Consolidate test CI and add concurrency limits (#3189) · IBMZ-Linux-OSS-Python/black@ef8deb6 · GitHub
[go: up one dir, main page]

Skip to content < 8000 react-partial partial-name="keyboard-shortcuts-dialog" data-ssr="false" data-attempted-ssr="false" data-react-profiling="false" >

Commit ef8deb6

Browse files
authored
Consolidate test CI and add concurrency limits (psf#3189)
1 parent 411ed77 commit ef8deb6

File tree

5 files changed

+52
-74
lines changed

5 files changed

+52
-74
lines changed

.github/workflows/doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Documentation Build
1+
name: Documentation
22

33
on: [push, pull_request]
44

.github/workflows/fuzz.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: Fuzz
22

33
on: [push, pull_request]
44

5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
7+
cancel-in-progress: true
8+
59
permissions:
610
contents: read
711

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v3
1818

19-
- name: Set up Python
19+
- name: Set up latest Python
2020
uses: actions/setup-python@v4
2121
with:
2222
python-version: "*"
@@ -27,9 +27,9 @@ jobs:
2727
python -m pip install -e '.[d]'
2828
python -m pip install tox
2929
30-
- name: Lint
30+
- name: Run pre-commit hooks
3131
uses: pre-commit/action@v3.0.0
3232

33-
- name: Run On Self
33+
- name: Format ourselves
3434
run: |
3535
tox -e run_self

.github/workflows/test.yml

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@ on:
1111
- "docs/**"
1212
- "*.md"
1313

14+
permissions:
15+
contents: read
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
19+
cancel-in-progress: true
20+
1421
jobs:
15-
build:
22+
main:
1623
# We want to run on external PRs, but not on our own internal PRs as they'll be run
1724
# by the push to the branch. Without this if check, checks are duplicated since
1825
# internal PRs match both the push and pull_request events.
@@ -35,29 +42,23 @@ jobs:
3542
with:
3643
python-version: ${{ matrix.python-version }}
3744

38-
- name: Install dependencies
45+
- name: Install tox
3946
run: |
4047
python -m pip install --upgrade pip
4148
python -m pip install --upgrade tox
4249
4350
- name: Unit tests
4451
if: "!startsWith(matrix.python-version, 'pypy')"
45-
run: |
46-
tox -e ci-py -- -v --color=yes
52+
run: tox -e ci-py -- -v --color=yes
4753

48-
- name: Unit tests pypy
54+
- name: Unit tests (pypy)
4955
if: "startsWith(matrix.python-version, 'pypy')"
50-
run: |
51-
tox -e ci-pypy3 -- -v --color=yes
56+
run: tox -e ci-pypy3 -- -v --color=yes
5257

53-
- name: Publish coverage to Coveralls
54-
# If pushed / is a pull request against main repo AND
58+
- name: Upload coverage to Coveralls
59+
# Upload coverage if we are on the main repository and
5560
# we're running on Linux (this action only supports Linux)
56-
if:
57-
((github.event_name == 'push' && github.repository == 'psf/black') ||
58-
github.event.pull_request.base.repo.full_name == 'psf/black') && matrix.os ==
59-
'ubuntu-latest'
60-
61+
if: github.repository == 'psf/black' && matrix.os == 'ubuntu-latest'
6162
uses: AndreMiras/coveralls-python-action@v20201129
6263
with:
6364
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -66,17 +67,40 @@ jobs:
6667
debug: true
6768

6869
coveralls-finish:
69-
needs: build
70-
# If pushed / is a pull request against main repo
71-
if:
72-
(github.event_name == 'push' && github.repository == 'psf/black') ||
73-
github.event.pull_request.base.repo.full_name == 'psf/black'
70+
needs: main
71+
if: github.repository == 'psf/black'
7472

7573
runs-on: ubuntu-latest
7674
steps:
7775
- uses: actions/checkout@v3
78-
- name: Coveralls finished
76+
- name: Send finished signal to Coveralls
7977
uses: AndreMiras/coveralls-python-action@v20201129
8078
with:
8179
parallel-finished: true
8280
debug: true
81+
82+
uvloop:
83+
if:
84+
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
85+
github.repository
86+
runs-on: ${{ matrix.os }}
87+
strategy:
88+
fail-fast: false
89+
matrix:
90+
os: [ubuntu-latest, macOS-latest]
91+
92+
steps:
93+
- uses: actions/checkout@v3
94+
95+
- name: Set up latest Python
96+
uses: actions/setup-python@v4
97+
with:
98+
python-version: "*"
99+
100+
- name: Install black with uvloop
101+
run: |
102+
python -m pip install pip --upgrade --disable-pip-version-check
103+
python -m pip install -e ".[uvloop]"
104+
105+
- name: Format ourselves
106+
run: python -m black --check src/

.github/workflows/uvloop_test.yml

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

0 commit comments

Comments
 (0)
0