Skip to content

Commit 5f073a5

Browse files
authored
#301: Update PTB and workflows and activate generation of GH pages (#302)
fixes #301
1 parent c1ef44d commit 5f073a5

29 files changed

+1760
-1201
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ jobs:
1111
cd-job:
1212
name: Continuous Delivery
1313
runs-on: ubuntu-24.04
14+
permissions:
15+
contents: write
1416
steps:
15-
1617
- name: SCM Checkout
1718
uses: actions/checkout@v4
1819

1920
- name: Setup Python & Poetry Environment
20-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
21-
with:
22-
python-version: '3.10'
23-
poetry-version: '2.1.2'
21+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
2422

2523
- name: Build Artifacts
2624
run: poetry build

.github/workflows/cd.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,22 @@ jobs:
1010
check-tag-version-job:
1111
name: Check Release Tag
1212
uses: ./.github/workflows/check-release-tag.yml
13+
permissions:
14+
contents: read
1315

1416
cd-job:
1517
name: Continuous Delivery
1618
uses: ./.github/workflows/build-and-publish.yml
19+
permissions:
20+
contents: write
1721
secrets:
1822
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
23+
24+
publish-docs:
25+
needs: [ cd-job ]
26+
name: Publish Documentation
27+
uses: ./.github/workflows/gh-pages.yml
28+
permissions:
29+
contents: read
30+
pages: write
31+
id-token: write

.github/workflows/check-release-tag.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
name: Check Release Tag
22

3-
on: workflow_call
3+
on:
4+
workflow_call:
45

56
jobs:
67

78
check-tag-version-job:
8-
99
name: Check Tag Version
1010
runs-on: ubuntu-24.04
11-
11+
permissions:
12+
contents: read
1213
steps:
1314
- name: SCM Checkout
1415
uses: actions/checkout@v4
1516

1617
- name: Setup Python & Poetry Environment
17-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
18+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
1819

1920
- name: Check Tag Version
2021
# make sure the pushed/created tag matched the project version

.github/workflows/checks.yml

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,58 @@ on:
44
workflow_call:
55

66
jobs:
7-
87
Version-Check:
98
name: Version
109
runs-on: ubuntu-24.04
11-
10+
permissions:
11+
contents: read
1212
steps:
1313
- name: SCM Checkout
1414
uses: actions/checkout@v4
1515
with:
1616
fetch-depth: 0
1717

1818
- name: Setup Python & Poetry Environment
19-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
19+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
2020

2121
- name: Check Version(s)
22+
run: poetry run -- nox -s version:check
23+
24+
Documentation:
25+
name: Docs
26+
needs: [ Version-Check ]
27+
runs-on: ubuntu-24.04
28+
permissions:
29+
contents: read
30+
steps:
31+
- name: SCM Checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Setup Python & Poetry Environment
35+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
36+
37+
- name: Build Documentation
2238
run: |
23-
poetry run -- nox -s version:check
39+
poetry run -- nox -s docs:build
2440
2541
build-matrix:
2642
name: Generate Build Matrix
2743
uses: ./.github/workflows/matrix-python.yml
44+
permissions:
45+
contents: read
2846

2947
Changelog:
3048
name: Changelog Update Check
3149
runs-on: ubuntu-24.04
50+
permissions:
51+
contents: read
3252
if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' }}
33-
3453
steps:
3554
- name: SCM Checkout
3655
uses: actions/checkout@v4
3756

3857
- name: Setup Python & Poetry Environment
39-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
58+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
4059

4160
- name: Run changelog update check
4261
run: poetry run -- nox -s changelog:updated
@@ -45,24 +64,25 @@ jobs:
4564
name: Linting (Python-${{ matrix.python-version }})
4665
needs: [ Version-Check, build-matrix ]
4766
runs-on: ubuntu-24.04
67+
permissions:
68+
contents: read
4869
strategy:
4970
fail-fast: false
5071
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
51-
5272
steps:
5373
- name: SCM Checkout
5474
uses: actions/checkout@v4
5575

5676
- name: Setup Python & Poetry Environment
57-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
77+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
5878
with:
5979
python-version: ${{ matrix.python-version }}
6080

6181
- name: Run lint
6282
run: poetry run -- nox -s lint:code
6383

6484
- name: Upload Artifacts
65-
uses: actions/upload-artifact@v4.6.0
85+
uses: actions/upload-artifact@v4.6.2
6686
with:
6787
name: lint-python${{ matrix.python-version }}
6888
path: |
@@ -74,6 +94,8 @@ jobs:
7494
name: Type Checking (Python-${{ matrix.python-version }})
7595
needs: [ Version-Check, build-matrix ]
7696
runs-on: ubuntu-24.04
97+
permissions:
98+
contents: read
7799
strategy:
78100
fail-fast: false
79101
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
@@ -83,7 +105,7 @@ jobs:
83105
uses: actions/checkout@v4
84106

85107
- name: Setup Python & Poetry Environment
86-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
108+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
87109
with:
88110
python-version: ${{ matrix.python-version }}
89111

@@ -94,6 +116,8 @@ jobs:
94116
name: Security Checks (Python-${{ matrix.python-version }})
95117
needs: [ Version-Check, build-matrix ]
96118
runs-on: ubuntu-24.04
119+
permissions:
120+
contents: read
97121
strategy:
98122
fail-fast: false
99123
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
@@ -103,15 +127,15 @@ jobs:
103127
uses: actions/checkout@v4
104128

105129
- name: Setup Python & Poetry Environment
106-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
130+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
107131
with:
108132
python-version: ${{ matrix.python-version }}
109133

110134
- name: Run security linter
111135
run: poetry run -- nox -s lint:security
112136

113137
- name: Upload Artifacts
114-
uses: actions/upload-artifact@v4.6.0
138+
uses: actions/upload-artifact@v4.6.2
115139
with:
116140
name: security-python${{ matrix.python-version }}
117141
path: .security.json
@@ -120,21 +144,24 @@ jobs:
120144
Format:
121145
name: Format Check
122146
runs-on: ubuntu-24.04
123-
147+
permissions:
148+
contents: read
124149
steps:
125150
- name: SCM Checkout
126151
uses: actions/checkout@v4
127152

128153
- name: Setup Python & Poetry Environment
129-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
154+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
130155

131156
- name: Run format check
132157
run: poetry run -- nox -s project:format
133158

134159
Tests:
135160
name: Unit-Tests (Python-${{ matrix.python-version }})
136-
needs: [ Lint, Type-Check, Security, Format, build-matrix ]
161+
needs: [ Documentation, Lint, Type-Check, Security, Format, build-matrix ]
137162
runs-on: ubuntu-24.04
163+
permissions:
164+
contents: read
138165
env:
139166
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140167
strategy:
@@ -146,15 +173,15 @@ jobs:
146173
uses: actions/checkout@v4
147174

148175
- name: Setup Python & Poetry Environment
149-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
176+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
150177
with:
151178
python-version: ${{ matrix.python-version }}
152179

153180
- name: Run Tests and Collect Coverage
154181
run: poetry run -- nox -s test:unit -- --coverage
155182

156183
- name: Upload Artifacts
157-
uses: actions/upload-artifact@v4.6.0
184+
uses: actions/upload-artifact@v4.6.2
158185
with:
159186
name: coverage-python${{ matrix.python-version }}-fast
160187
path: .coverage

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@ on:
1010
schedule:
1111
# “At 00:00 on every 7th day-of-month from 1 through 31.” (https://crontab.guru)
1212
- cron: "0 0 1/7 * *"
13-
1413
jobs:
1514

1615
CI:
1716
uses: ./.github/workflows/merge-gate.yml
1817
secrets: inherit
18+
permissions:
19+
contents: read
20+
21+
Metrics:
22+
needs: [ CI ]
23+
uses: ./.github/workflows/report.yml
24+
permissions:
25+
contents: read

.github/workflows/gh-pages.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish Documentation
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
jobs:
8+
9+
build-documentation:
10+
runs-on: ubuntu-24.04
11+
permissions:
12+
contents: read
13+
steps:
14+
- name: SCM Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Setup Python & Poetry Environment
20+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
21+
22+
- name: Build Documentation
23+
run: |
24+
poetry run -- nox -s docs:multiversion
25+
rm -r .html-documentation/*/.doctrees
26+
27+
- name: Upload artifact
28+
uses: actions/upload-pages-artifact@v3
29+
with:
30+
path: .html-documentation
31+
32+
deploy-documentation:
33+
needs: [ build-documentation ]
34+
permissions:
35+
contents: read
36+
pages: write
37+
id-token: write
38+
environment:
39+
name: github-pages
40+
url: ${{ steps.deployment.outputs.page_url }}
41+
runs-on: ubuntu-24.04
42+
steps:
43+
- name: Deploy to GitHub Pages
44+
id: deployment
45+
uses: actions/deploy-pages@v4

.github/workflows/matrix-python.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ on:
99

1010
jobs:
1111
python_versions:
12-
1312
runs-on: ubuntu-24.04
14-
13+
permissions:
14+
contents: read
1515
steps:
1616
- name: SCM Checkout
1717
uses: actions/checkout@v4
1818

1919
- name: Setup Python & Poetry Environment
20-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
20+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
2121

2222
- name: Generate matrix
2323
run: poetry run -- nox -s matrix:python

.github/workflows/merge-gate.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,22 @@ jobs:
1212
fast-checks:
1313
name: Fast
1414
uses: ./.github/workflows/checks.yml
15+
permissions:
16+
contents: read
1517

1618
slow-checks:
1719
name: Slow
1820
uses: ./.github/workflows/slow-checks.yml
1921
secrets: inherit
22+
permissions:
23+
contents: read
2024

2125
# This job ensures inputs have been executed successfully.
2226
approve-merge:
2327
name: Allow Merge
2428
runs-on: ubuntu-24.04
29+
permissions:
30+
contents: read
2531
# If you need additional jobs to be part of the merge gate, add them below
2632
needs: [ fast-checks, slow-checks ]
2733

.github/workflows/pr-merge.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,19 @@ jobs:
1414
ci-job:
1515
name: Checks
1616
uses: ./.github/workflows/checks.yml
17-
secrets: inherit
17+
permissions:
18+
contents: read
19+
20+
publish-docs:
21+
name: Publish Documentation
22+
uses: ./.github/workflows/gh-pages.yml
23+
permissions:
24+
contents: read
25+
pages: write
26+
id-token: write
27+
28+
metrics:
29+
needs: [ ci-job ]
30+
uses: ./.github/workflows/report.yml
31+
permissions:
32+
contents: read

0 commit comments

Comments
 (0)