Skip to content

Commit ce81efd

Browse files
committed
feat: Adjust the GH action setup
1 parent 6d9a373 commit ce81efd

File tree

2 files changed

+58
-17
lines changed

2 files changed

+58
-17
lines changed

.github/workflows/pull-request-checks.yml

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
python-version: [ '3.x' ]
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1717

1818
- name: Set up Python
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v4
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222
architecture: x64
@@ -35,10 +35,10 @@ jobs:
3535
python-version: [ '3.x' ]
3636

3737
steps:
38-
- uses: actions/checkout@v2
38+
- uses: actions/checkout@v4
3939

4040
- name: Set up Python
41-
uses: actions/setup-python@v2
41+
uses: actions/setup-python@v4
4242
with:
4343
python-version: ${{ matrix.python-version }}
4444
architecture: x64
@@ -48,7 +48,7 @@ jobs:
4848
run: pip install -r requirements.txt
4949

5050
- name: Execute the linting checks
51-
uses: reviewdog/action-flake8@v3.2.0
51+
uses: reviewdog/action-flake8@v3.8.0
5252
with:
5353
github_token: ${{ secrets.GITHUB_TOKEN }}
5454
flake8_args: --config=.flake8
@@ -60,13 +60,13 @@ jobs:
6060
python-version: [ '3.x' ]
6161

6262
steps:
63-
- uses: actions/checkout@v2
63+
- uses: actions/checkout@v4
6464
with:
6565
persist-credentials: false
6666
fetch-depth: 0
6767

6868
- name: Set up Python
69-
uses: actions/setup-python@v2
69+
uses: actions/setup-python@v4
7070
with:
7171
python-version: ${{ matrix.python-version }}
7272
architecture: x64
@@ -79,7 +79,7 @@ jobs:
7979
run: export PYTHONPATH=$PWD && pytest --junitxml=pytest.xml --cov=. tests/ | tee pytest-coverage.txt
8080

8181
- name: Execute the coverage checks
82-
uses: MishaKav/[email protected].16
82+
uses: MishaKav/[email protected].48
8383
with:
8484
github_token: ${{ secrets.GITHUB_TOKEN }}
8585
pytest-coverage-path: ./pytest-coverage.txt
@@ -90,11 +90,8 @@ jobs:
9090
- name: Generate coverage badge
9191
run: coverage-badge -f -o docs/coverage.svg
9292

93-
- name: Generate documentation
94-
run: pydoc-markdown --render-toc && rm -rf docs/content && mv build/docs/* docs
95-
9693
- name: Check changed files
97-
uses: tj-actions/verify-changed-files@v8.8
94+
uses: tj-actions/verify-changed-files@v16
9895
id: verify-changed-files
9996
with:
10097
files: |
@@ -106,7 +103,7 @@ jobs:
106103
git config --local user.email "github-actions[bot]@users.noreply.github.com"
107104
git config --local user.name "github-actions[bot]"
108105
git add --force docs
109-
git commit -m "Add coverage badge and documentation"
106+
git commit -m "Add coverage badge"
110107
111108
- name: Push changes
112109
if: steps.verify-changed-files.outputs.files_changed == 'true'
@@ -115,3 +112,50 @@ jobs:
115112
github_token: ${{ secrets.GITHUB_TOKEN }}
116113
branch: ${{ github.head_ref }}
117114
force: true
115+
116+
documentation:
117+
runs-on: ubuntu-latest
118+
strategy:
119+
matrix:
120+
python-version: [ '3.9' ]
121+
122+
steps:
123+
- uses: actions/checkout@v4
124+
with:
125+
persist-credentials: false
126+
fetch-depth: 0
127+
128+
- name: Set up Python
129+
uses: actions/setup-python@v4
130+
with:
131+
python-version: ${{ matrix.python-version }}
132+
architecture: x64
133+
cache: 'pip'
134+
135+
- name: Install the requirements
136+
run: pip install pydoc-markdown==4.6.3 mkdocs mkdocs-material
137+
138+
- name: Generate documentation
139+
run: pydoc-markdown --render-toc && rm -rf docs/content && mv build/docs/* docs
140+
141+
- name: Check changed files
142+
uses: tj-actions/verify-changed-files@v16
143+
id: verify-changed-files
144+
with:
145+
files: |
146+
docs
147+
148+
- name: Commit files
149+
if: steps.verify-changed-files.outputs.files_changed == 'true'
150+
run: |
151+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
152+
git config --local user.name "github-actions[bot]"
153+
git add --force docs
154+
git commit -m "docs: Add the documentation"
155+
156+
- name: Push changes
157+
uses: ad-m/github-push-action@master
158+
if: steps.verify-changed-files.outputs.files_changed == 'true'
159+
with:
160+
github_token: ${{ secrets.GITHUB_TOKEN }}
161+
branch: ${{ github.head_ref }}

requirements.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
jinja2
2-
pydoc-markdown
3-
mkdocs
4-
mkdocs-material
1+
jinja2

0 commit comments

Comments
 (0)