11
11
- " docs/**"
12
12
- " *.md"
13
13
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
+
14
21
jobs :
15
- build :
22
+ main :
16
23
# We want to run on external PRs, but not on our own internal PRs as they'll be run
17
24
# by the push to the branch. Without this if check, checks are duplicated since
18
25
# internal PRs match both the push and pull_request events.
@@ -35,29 +42,23 @@ jobs:
35
42
with :
36
43
python-version : ${{ matrix.python-version }}
37
44
38
- - name : Install dependencies
45
+ - name : Install tox
39
46
run : |
40
47
python -m pip install --upgrade pip
41
48
python -m pip install --upgrade tox
42
49
43
50
- name : Unit tests
44
51
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
47
53
48
- - name : Unit tests pypy
54
+ - name : Unit tests ( pypy)
49
55
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
52
57
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
55
60
# 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'
61
62
uses : AndreMiras/coveralls-python-action@v20201129
62
63
with :
63
64
github-token : ${{ secrets.GITHUB_TOKEN }}
@@ -66,17 +67,40 @@ jobs:
66
67
debug : true
67
68
68
69
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'
74
72
75
73
runs-on : ubuntu-latest
76
74
steps :
77
75
- uses : actions/checkout@v3
78
- - name : Coveralls finished
76
+ - name : Send finished signal to Coveralls
79
77
uses : AndreMiras/coveralls-python-action@v20201129
80
78
with :
81
79
parallel-finished : true
82
80
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/
0 commit comments