Skip to content

Commit ff852bc

Browse files
committed
Update GitHub Actions workflows
1 parent bb9821b commit ff852bc

File tree

10 files changed

+193
-135
lines changed

10 files changed

+193
-135
lines changed

.github/workflows/builddoc.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,17 @@ jobs:
2020
with:
2121
python-version: 3
2222
- name: Install dependencies
23-
run: |
23+
run: |
2424
sudo apt update
2525
sudo apt install -y graphviz
26-
pip install -U tox
27-
- name: Run Tox
28-
run: tox -e docs
26+
python -m pip install --upgrade pip
27+
python -m pip install .[docs]
28+
- name: Render the documentation
29+
run: >
30+
python
31+
-X dev
32+
-X warn_default_encoding
33+
-m sphinx
34+
-M html ./doc ./build/sphinx
35+
-W
36+
--keep-going

.github/workflows/coverage.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on: [push]
55
permissions:
66
contents: read
77

8+
env:
9+
FORCE_COLOR: "1"
10+
811
jobs:
912
coverage:
1013
runs-on: ubuntu-latest
@@ -24,11 +27,16 @@ jobs:
2427
run: sudo apt-get install graphviz
2528

2629
- name: Install dependencies
27-
run: python -m pip install -U pip tox pytest-cov
30+
run: |
31+
python -m pip install --upgrade pip
32+
python -m pip install .[test] pytest-cov
2833
29-
- name: Run Tox
30-
run: tox -e py -- -vv
34+
- name: Test with pytest
35+
run: python -m pytest -vv
3136
env:
37+
PYTHONDEVMODE: "1" # -X dev
38+
PYTHONWARNDEFAULTENCODING: "1" # -X warn_default_encoding
39+
PYTHONWARNINGS: "always" # -W always
3240
PYTEST_ADDOPTS: "--cov ./ --cov-append --cov-config pyproject.toml"
3341
VIRTUALENV_SYSTEM_SITE_PACKAGES: "1"
3442

.github/workflows/latex.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,23 @@ jobs:
1616
container:
1717
image: ghcr.io/sphinx-doc/sphinx-ci
1818
env:
19-
DO_EPUBCHECK: 1
19+
DO_EPUBCHECK: "1"
2020
steps:
2121
- name: Alias python3 to python
2222
run: ln -s /usr/bin/python3 /usr/bin/python
2323
- uses: actions/checkout@v3
2424
- name: Check Python version
2525
run: python --version
2626
- name: Install dependencies
27-
run: pip install -U pip tox
28-
- name: Run Tox
29-
run: tox -e py -- -vv
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install .[test]
30+
- name: Test with pytest
31+
run: >
32+
python
33+
-X dev
34+
-X warn_default_encoding
35+
-m pytest
36+
-vv
37+
--color yes
38+
--durations 25

.github/workflows/lint.yml

Lines changed: 85 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,11 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
env:
13-
FORCE_COLOR: 1
13+
FORCE_COLOR: "1"
1414

1515
jobs:
16-
build:
16+
ruff:
1717
runs-on: ubuntu-latest
18-
strategy:
19-
fail-fast: false
20-
matrix:
21-
tool: [docslint, flake8, isort, mypy, twine]
2218

2319
steps:
2420
- uses: actions/checkout@v3
@@ -27,11 +23,13 @@ jobs:
2723
with:
2824
python-version: 3
2925
- name: Install dependencies
30-
run: python -m pip install -U tox pip
31-
- name: Run Tox
32-
run: tox -e ${{ matrix.tool }}
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install --upgrade ruff
29+
- name: Lint with Ruff
30+
run: ruff . --diff --format github
3331

34-
ruff:
32+
flake8:
3533
runs-on: ubuntu-latest
3634

3735
steps:
@@ -41,8 +39,81 @@ jobs:
4139
with:
4240
python-version: 3
4341
- name: Install dependencies
44-
run: |
42+
run: |
4543
python -m pip install --upgrade pip
46-
python -m pip install --upgrade ruff
47-
- name: Lint with Ruff
48-
run: ruff . --diff --format github
44+
python -m pip install --upgrade "flake8>=3.5.0" "flake8-simplify"
45+
- name: Lint with flake8
46+
run: flake8 .
47+
48+
isort:
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- uses: actions/checkout@v3
53+
- name: Set up Python
54+
uses: actions/setup-python@v4
55+
with:
56+
python-version: 3
57+
- name: Install dependencies
58+
run: |
59+
python -m pip install --upgrade pip
60+
python -m pip install --upgrade isort
61+
- name: Lint with isort
62+
run: isort --check-only --diff .
63+
64+
mypy:
65+
runs-on: ubuntu-latest
66+
67+
steps:
68+
- uses: actions/checkout@v3
69+
- name: Set up Python
70+
uses: actions/setup-python@v4
71+
with:
72+
python-version: 3
73+
- name: Install dependencies
74+
run: |
75+
python -m pip install --upgrade pip
76+
python -m pip install --upgrade "mypy>=0.990" docutils-stubs types-requests
77+
- name: Type check with mypy
78+
run: mypy sphinx/
79+
80+
docs-lint:
81+
runs-on: ubuntu-latest
82+
83+
steps:
84+
- uses: actions/checkout@v3
85+
- name: Set up Python
86+
uses: actions/setup-python@v4
87+
with:
88+
python-version: 3
89+
- name: Install dependencies
90+
run: |
91+
python -m pip install --upgrade pip
92+
python -m pip install --upgrade sphinx-lint
93+
- name: Lint documentation with sphinx-lint
94+
run: >
95+
sphinx-lint
96+
--enable line-too-long
97+
--max-line-length 85
98+
CHANGES
99+
CONTRIBUTING.rst
100+
README.rst
101+
doc/
102+
103+
twine:
104+
runs-on: ubuntu-latest
105+
106+
steps:
107+
- uses: actions/checkout@v3
108+
- name: Set up Python
109+
uses: actions/setup-python@v4
110+
with:
111+
python-version: 3
112+
- name: Install dependencies
113+
run: |
114+
python -m pip install --upgrade pip
115+
python -m pip install --upgrade twine build
116+
- name: Lint with twine
117+
run: |
118+
python -m build .
119+
twine check dist/*

.github/workflows/lock.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: 'Lock old threads'
1+
name: Lock old threads
22

33
on:
44
schedule:
5-
- cron: '0 0 * * *'
5+
- cron: "0 0 * * *"
66

77
permissions:
88
issues: write
@@ -16,5 +16,5 @@ jobs:
1616
- uses: dessant/lock-threads@v3
1717
with:
1818
github-token: ${{ github.token }}
19-
issue-inactive-days: '30'
20-
pr-inactive-days: '30'
19+
issue-inactive-days: "30"
20+
pr-inactive-days: "30"

.github/workflows/main.yml

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1010
cancel-in-progress: true
1111

12+
env:
13+
FORCE_COLOR: "1"
14+
PYTHONDEVMODE: "1" # -X dev
15+
PYTHONWARNDEFAULTENCODING: "1" # -X warn_default_encoding
16+
PYTHONWARNINGS: "always" # -W always
17+
1218
jobs:
1319
ubuntu:
1420
runs-on: ubuntu-latest
15-
name: Python ${{ matrix.python }} (${{ matrix.docutils }})
21+
name: Python ${{ matrix.python }} (Docutils ${{ matrix.docutils }})
1622
strategy:
1723
fail-fast: false
1824
matrix:
@@ -23,9 +29,8 @@ jobs:
2329
- "3.11"
2430
- "3.12-dev"
2531
docutils:
26-
- "du18"
27-
- "du19"
28-
- "du-latest"
32+
- "0.18"
33+
- "0.19"
2934

3035
steps:
3136
- uses: actions/checkout@v3
@@ -44,19 +49,50 @@ jobs:
4449
- name: Install graphviz
4550
run: sudo apt-get install graphviz
4651
- name: Install dependencies
47-
run: python -m pip install -U pip tox
48-
- name: Run Tox
49-
run: tox -e ${{ matrix.docutils }} -- -vv
52+
run: |
53+
python -m pip install --upgrade pip
54+
python -m pip install .[test]
55+
- name: Install Docutils ${{ matrix.docutils }}
56+
run: python -m pip install --upgrade "docutils==${{ matrix.docutils }}.*"
57+
- name: Test with pytest
58+
run: python -m pytest -vv --durations 25
5059

5160
windows:
5261
runs-on: windows-2019
62+
name: Windows
63+
5364
steps:
5465
- uses: actions/checkout@v3
5566
- name: Set up Python
5667
uses: actions/setup-python@v4
5768
with:
5869
python-version: 3
5970
- name: Install dependencies
60-
run: python -m pip install -U pip tox
61-
- name: Run Tox
62-
run: tox -e py -- -vv
71+
run: |
72+
python -m pip install --upgrade pip
73+
python -m pip install .[test]
74+
- name: Test with pytest
75+
run: python -m pytest -vv --durations 25
76+
77+
docutils-latest:
78+
runs-on: ubuntu-latest
79+
name: Docutils HEAD
80+
81+
steps:
82+
- uses: actions/checkout@v3
83+
- name: Set up Python 3
84+
uses: actions/setup-python@v4
85+
with:
86+
python-version: "3"
87+
- name: Check Python version
88+
run: python --version
89+
- name: Install graphviz
90+
run: sudo apt-get install graphviz
91+
- name: Install dependencies
92+
run: |
93+
python -m pip install --upgrade pip
94+
python -m pip install .[test]
95+
- name: Install Docutils' HEAD
96+
run: python -m pip install git+https://repo.or.cz/docutils.git\#subdirectory=docutils
97+
- name: Test with pytest
98+
run: python -m pytest -vv

.github/workflows/nodejs.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
build:
1414
runs-on: ubuntu-latest
1515
env:
16-
node-version: 16
16+
node-version: "16"
1717

1818
steps:
1919
- uses: actions/checkout@v3
@@ -24,6 +24,4 @@ jobs:
2424
cache: "npm"
2525
- run: npm install
2626
- name: Run headless test
27-
uses: GabrielBB/xvfb-action@v1
28-
with:
29-
run: npm test
27+
run: xvfb-run -a npm test

.github/workflows/transifex.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ jobs:
2222
with:
2323
python-version: 3.9 # https://github.com/transifex/transifex-client/pull/330
2424
- name: Install dependencies
25-
run: pip install -U babel jinja2 transifex-client
25+
run: pip install -U babel jinja2 transifex-client
2626
- name: Install Sphinx
27-
run: pip install .
27+
run: pip install .
2828
- name: Extract translations from source code
29-
run: python utils/babel_runner.py extract
29+
run: python utils/babel_runner.py extract
3030
- name: Push translations to transifex.com
31-
run: cd sphinx/locale && tx push -s --no-interactive --parallel
31+
run: cd sphinx/locale && tx push -s --no-interactive --parallel
3232
env:
33-
TX_TOKEN: ${{ secrets.TX_TOKEN }}
33+
TX_TOKEN: "${{ secrets.TX_TOKEN }}"
3434

3535
pull:
3636
permissions:
@@ -48,21 +48,21 @@ jobs:
4848
with:
4949
python-version: 3.9 # https://github.com/transifex/transifex-client/pull/330
5050
- name: Install dependencies
51-
run: pip install -U babel jinja2 transifex-client
51+
run: pip install -U babel jinja2 transifex-client
5252
- name: Install Sphinx
53-
run: pip install .
53+
run: pip install .
5454
- name: Extract translations from source code
55-
run: python utils/babel_runner.py extract
55+
run: python utils/babel_runner.py extract
5656
- name: Pull translations to transifex.com
57-
run: cd sphinx/locale && tx pull -a -f --no-interactive --parallel
57+
run: cd sphinx/locale && tx pull -a -f --no-interactive --parallel
5858
env:
59-
TX_TOKEN: ${{ secrets.TX_TOKEN }}
59+
TX_TOKEN: "${{ secrets.TX_TOKEN }}"
6060
- name: Compile message catalogs
61-
run: python utils/babel_runner.py compile
61+
run: python utils/babel_runner.py compile
6262
- name: Create Pull Request
6363
uses: peter-evans/create-pull-request@v4
6464
with:
65-
commit-message: 'Update message catalogs'
65+
commit-message: "Update message catalogs"
6666
branch: bot/pull-translations
6767
title: Update message catalogs
6868
labels: i18n

0 commit comments

Comments
 (0)