Skip to content

Commit 2ab5262

Browse files
authored
#98: Updated saas-api to version >1.0,<2.0 and pytest-backend (#100)
* #98: Updated saas-api to version >1.0,<2.0 and pytest-backend * Updated PTB generated workflows * Fixed type hints * Inherit secrets
1 parent 63824ee commit 2ab5262

25 files changed

+639
-471
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +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+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
2122

2223
- name: Build Artifacts
2324
run: poetry build

.github/workflows/cd.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,23 @@ 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 }}
1923

2024
publish-docs:
2125
needs: [ cd-job ]
2226
name: Publish Documentation
2327
uses: ./.github/workflows/gh-pages.yml
28+
permissions:
29+
contents: read
30+
pages: write
31+
id-token: write
2432

.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: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,35 @@ 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 -- version-check version.py
22+
run: poetry run -- nox -s version:check
2323

2424
Documentation:
2525
name: Docs
2626
needs: [ Version-Check ]
2727
runs-on: ubuntu-24.04
28-
28+
permissions:
29+
contents: read
2930
steps:
3031
- name: SCM Checkout
3132
uses: actions/checkout@v4
3233

3334
- name: Setup Python & Poetry Environment
34-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
35+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
3536

3637
- name: Build Documentation
3738
run: |
@@ -40,18 +41,21 @@ jobs:
4041
build-matrix:
4142
name: Generate Build Matrix
4243
uses: ./.github/workflows/matrix-python.yml
44+
permissions:
45+
contents: read
4346

4447
Changelog:
4548
name: Changelog Update Check
4649
runs-on: ubuntu-24.04
50+
permissions:
51+
contents: read
4752
if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' }}
48-
4953
steps:
5054
- name: SCM Checkout
5155
uses: actions/checkout@v4
5256

5357
- name: Setup Python & Poetry Environment
54-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
58+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
5559

5660
- name: Run changelog update check
5761
run: poetry run -- nox -s changelog:updated
@@ -60,24 +64,25 @@ jobs:
6064
name: Linting (Python-${{ matrix.python-version }})
6165
needs: [ Version-Check, build-matrix ]
6266
runs-on: ubuntu-24.04
67+
permissions:
68+
contents: read
6369
strategy:
6470
fail-fast: false
6571
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
66-
6772
steps:
6873
- name: SCM Checkout
6974
uses: actions/checkout@v4
7075

7176
- name: Setup Python & Poetry Environment
72-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
77+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
7378
with:
7479
python-version: ${{ matrix.python-version }}
7580

7681
- name: Run lint
7782
run: poetry run -- nox -s lint:code
7883

7984
- name: Upload Artifacts
80-
uses: actions/[email protected].0
85+
uses: actions/[email protected].2
8186
with:
8287
name: lint-python${{ matrix.python-version }}
8388
path: |
@@ -89,6 +94,8 @@ jobs:
8994
name: Type Checking (Python-${{ matrix.python-version }})
9095
needs: [ Version-Check, build-matrix ]
9196
runs-on: ubuntu-24.04
97+
permissions:
98+
contents: read
9299
strategy:
93100
fail-fast: false
94101
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
@@ -98,7 +105,7 @@ jobs:
98105
uses: actions/checkout@v4
99106

100107
- name: Setup Python & Poetry Environment
101-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
108+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
102109
with:
103110
python-version: ${{ matrix.python-version }}
104111

@@ -109,6 +116,8 @@ jobs:
109116
name: Security Checks (Python-${{ matrix.python-version }})
110117
needs: [ Version-Check, build-matrix ]
111118
runs-on: ubuntu-24.04
119+
permissions:
120+
contents: read
112121
strategy:
113122
fail-fast: false
114123
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
@@ -118,15 +127,15 @@ jobs:
118127
uses: actions/checkout@v4
119128

120129
- name: Setup Python & Poetry Environment
121-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
130+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
122131
with:
123132
python-version: ${{ matrix.python-version }}
124133

125134
- name: Run security linter
126135
run: poetry run -- nox -s lint:security
127136

128137
- name: Upload Artifacts
129-
uses: actions/[email protected].0
138+
uses: actions/[email protected].2
130139
with:
131140
name: security-python${{ matrix.python-version }}
132141
path: .security.json
@@ -135,21 +144,24 @@ jobs:
135144
Format:
136145
name: Format Check
137146
runs-on: ubuntu-24.04
138-
147+
permissions:
148+
contents: read
139149
steps:
140150
- name: SCM Checkout
141151
uses: actions/checkout@v4
142152

143153
- name: Setup Python & Poetry Environment
144-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
154+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
145155

146156
- name: Run format check
147157
run: poetry run -- nox -s project:format
148158

149159
Tests:
150-
name: Unit-Tests (Python-${{ matrix.python-version }}, Exasol-${{ matrix.exasol-version}})
160+
name: Unit-Tests (Python-${{ matrix.python-version }})
151161
needs: [ Documentation, Lint, Type-Check, Security, Format, build-matrix ]
152162
runs-on: ubuntu-24.04
163+
permissions:
164+
contents: read
153165
env:
154166
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
155167
strategy:
@@ -161,15 +173,15 @@ jobs:
161173
uses: actions/checkout@v4
162174

163175
- name: Setup Python & Poetry Environment
164-
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
176+
uses: exasol/python-toolbox/.github/actions/python-environment@1.4.0
165177
with:
166178
python-version: ${{ matrix.python-version }}
167179

168180
- name: Run Tests and Collect Coverage
169181
run: poetry run -- nox -s test:unit -- --coverage
170182

171183
- name: Upload Artifacts
172-
uses: actions/[email protected].0
184+
uses: actions/[email protected].2
173185
with:
174186
name: coverage-python${{ matrix.python-version }}-fast
175187
path: .coverage

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ on:
88
- "main"
99
- "master"
1010
schedule:
11-
# At 00:00 on every 7th day-of-month from 1 through 31. (https://crontab.guru)
11+
# "At 00:00 on every 7th day-of-month from 1 through 31." (https://crontab.guru)
1212
- cron: "0 0 1/7 * *"
1313

1414
jobs:
1515

1616
CI:
1717
uses: ./.github/workflows/merge-gate.yml
1818
secrets: inherit
19+
permissions:
20+
contents: read
1921

2022
Metrics:
2123
needs: [ CI ]
2224
uses: ./.github/workflows/report.yml
25+
permissions:
26+
contents: read

.github/workflows/gh-pages.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,40 @@ on:
66

77
jobs:
88

9-
documentation-job:
9+
build-documentation:
1010
runs-on: ubuntu-24.04
11-
11+
permissions:
12+
contents: read
1213
steps:
1314
- name: SCM Checkout
1415
uses: actions/checkout@v4
1516
with:
1617
fetch-depth: 0
1718

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

2122
- name: Build Documentation
2223
run: |
2324
poetry run -- nox -s docs:multiversion
25+
rm -r .html-documentation/*/.doctrees
2426
25-
- name: Deploy
26-
uses: JamesIves/github-pages-[email protected]
27+
- name: Upload artifact
28+
uses: actions/upload-pages-artifact@v3
2729
with:
28-
branch: gh-pages
29-
folder: .html-documentation
30-
git-config-name: Github Action
31-
git-config-email: [email protected]
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-all.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Matrix (All Versions)
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
matrix:
7+
description: "Generates the all versions build matrix"
8+
value: ${{ jobs.all_versions.outputs.matrix }}
9+
10+
jobs:
11+
all_versions:
12+
runs-on: ubuntu-24.04
13+
permissions:
14+
contents: read
15+
steps:
16+
- name: SCM Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Python & Poetry Environment
20+
uses: exasol/python-toolbox/.github/actions/[email protected]
21+
22+
- name: Generate matrix
23+
run: poetry run -- nox -s matrix:all
24+
25+
- id: set-matrix
26+
run: |
27+
echo "matrix=$(poetry run -- nox -s matrix:all)" >> $GITHUB_OUTPUT
28+
29+
outputs:
30+
matrix: ${{ steps.set-matrix.outputs.matrix }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Matrix (Exasol)
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
matrix:
7+
description: "Generates the exasol version build matrix"
8+
value: ${{ jobs.exasol_versions.outputs.matrix }}
9+
10+
jobs:
11+
exasol_versions:
12+
runs-on: ubuntu-24.04
13+
permissions:
14+
contents: read
15+
steps:
16+
- name: SCM Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Python & Poetry Environment
20+
uses: exasol/python-toolbox/.github/actions/[email protected]
21+
22+
- name: Generate matrix
23+
run: poetry run -- nox -s matrix:exasol
24+
25+
- id: set-matrix
26+
run: |
27+
echo "matrix=$(poetry run -- nox -s matrix:exasol)" >> $GITHUB_OUTPUT
28+
29+
outputs:
30+
matrix: ${{ steps.set-matrix.outputs.matrix }}

0 commit comments

Comments
 (0)