Skip to content

Commit 5ea476f

Browse files
authored
Merge branch 'main' into correction-format-check-github-workflow-task
2 parents b104b4a + e1b4e50 commit 5ea476f

File tree

23 files changed

+860
-50
lines changed

23 files changed

+860
-50
lines changed

.github/workflows/checks.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,17 @@ jobs:
4040
run: |
4141
poetry run python -m nox -s docs:build
4242
43+
build-matrix:
44+
name: Generate Build Matrix
45+
uses: ./.github/workflows/matrix-python.yml
46+
4347
Lint:
4448
name: Linting (Python-${{ matrix.python-version }})
45-
needs: [ Version-Check ]
49+
needs: [ Version-Check, build-matrix ]
4650
runs-on: ubuntu-latest
4751
strategy:
4852
fail-fast: false
49-
matrix:
50-
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
53+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
5154

5255
steps:
5356
- name: SCM Checkout
@@ -70,12 +73,11 @@ jobs:
7073

7174
Type-Check:
7275
name: Type Checking (Python-${{ matrix.python-version }})
73-
needs: [ Version-Check ]
76+
needs: [ Version-Check, build-matrix ]
7477
runs-on: ubuntu-latest
7578
strategy:
7679
fail-fast: false
77-
matrix:
78-
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
80+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
7981

8082
steps:
8183
- name: SCM Checkout
@@ -91,12 +93,11 @@ jobs:
9193

9294
Security:
9395
name: Security Checks (Python-${{ matrix.python-version }})
94-
needs: [ Version-Check ]
96+
needs: [ Version-Check, build-matrix ]
9597
runs-on: ubuntu-latest
9698
strategy:
9799
fail-fast: false
98-
matrix:
99-
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
100+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
100101

101102
steps:
102103
- name: SCM Checkout
@@ -134,16 +135,14 @@ jobs:
134135
run: poetry run nox -s project:format
135136

136137
Tests:
137-
name: Unit-Tests (Python-${{ matrix.python-version }}, Exasol-${{ matrix.exasol-version}})
138-
needs: [ Documentation, Lint, Type-Check, Security, Format]
138+
name: Unit-Tests (Python-${{ matrix.python-version }})
139+
needs: [ Documentation, Lint, Type-Check, Security, Format, build-matrix ]
139140
runs-on: ubuntu-latest
140141
env:
141142
GITHUB_TOKEN: ${{ secrets.ALTERNATIVE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
142143
strategy:
143144
fail-fast: false
144-
matrix:
145-
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
146-
exasol-version: [ "7.1.9" ]
145+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
147146

148147
steps:
149148
- name: SCM Checkout
@@ -155,7 +154,7 @@ jobs:
155154
python-version: ${{ matrix.python-version }}
156155

157156
- name: Run Tests and Collect Coverage
158-
run: poetry run nox -s test:unit -- -- --coverage --db-version ${{ matrix.exasol-version }}
157+
run: poetry run nox -s test:unit -- -- --coverage
159158

160159
- name: Upload Artifacts
161160
uses: actions/[email protected]

.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+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: SCM Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Python & Poetry Environment
20+
uses: ./.github/actions/python-environment
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+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: SCM Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Python & Poetry Environment
20+
uses: ./.github/actions/python-environment
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 }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Matrix (Python)
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
matrix:
7+
description: "Generates the python version build matrix"
8+
value: ${{ jobs.python_versions.outputs.matrix }}
9+
10+
jobs:
11+
python_versions:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: SCM Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Python & Poetry Environment
20+
uses: ./.github/actions/python-environment
21+
22+
- name: Generate matrix
23+
run: poetry run nox -s matrix:python
24+
25+
- id: set-matrix
26+
run: |
27+
echo "matrix=$(poetry run nox -s matrix:python)" >> $GITHUB_OUTPUT
28+
29+
outputs:
30+
matrix: ${{ steps.set-matrix.outputs.matrix }}

.github/workflows/report.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@ jobs:
3131
working-directory: ./artifacts
3232
run: |
3333
poetry run coverage combine --keep coverage-python3.9*/.coverage
34-
cp .coverage ../
35-
cp lint-python3.9/.lint.txt ../
36-
cp security-python3.9/.security.json ../
34+
cp .coverage ../ || true
35+
cp lint-python3.9/.lint.txt ../ || true
36+
cp security-python3.9/.security.json ../ || true
37+
38+
- name: Validate Artifacts
39+
run: poetry run nox -s artifacts:validate
3740

3841
- name: Generate Report
3942
run: poetry run nox -s project:report -- -- --format json | tee metrics.json

.github/workflows/slow-checks.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ on:
88

99
jobs:
1010

11+
build-matrix:
12+
name: Generate Build Matrix
13+
uses: ./.github/workflows/matrix-all.yml
14+
1115
Tests:
1216
name: Integration-Tests (Python-${{ matrix.python-version }}, Exasol-${{ matrix.exasol-version}})
17+
needs: [ build-matrix ]
1318
runs-on: ubuntu-latest
1419
# Even though the environment "manual-approval" will be created automatically,
1520
# it still needs to be configured to require interactive review.
@@ -19,9 +24,7 @@ jobs:
1924
GITHUB_TOKEN: ${{ secrets.ALTERNATIVE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
2025
strategy:
2126
fail-fast: false
22-
matrix:
23-
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
24-
exasol-version: [ "7.1.9" ]
27+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
2528

2629
steps:
2730
- name: SCM Checkout

doc/changes/unreleased.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# Unreleased
22

3+
## 🚨 Breaking Changes
4+
* **Matrices in CI/CD workflows will be generated automatically now**
5+
6+
Make sure you have installed all the latest workflow files, especially the newly added ones:
7+
8+
- `matrix-all.yml`
9+
- `matrix-python.yml`
10+
- `matrix-exasol.yml`
11+
12+
13+
## ✨ Added
14+
* Added support for dynamically generated workflow matrices.
15+
16+
This feature allows you to easily change the test matrices in one place: `noxconfig.py`.
17+
18+
Note: As usual, there are different ways a user can adjust or change the behavior. In the case of the build matrices, there are three obvious ways:
19+
20+
- Set the appropriate fields in the `noxconfig.py` project configuration (`PROJECT_CONFIG`):
21+
* `python_versions = [ ... ]`
22+
* `exasol_versions = [ ... ]`
23+
- Overwrite the nox tasks:
24+
* `matrix:all`
25+
* `matrix:python`
26+
* `matrix:exasol`
27+
- Overwrite/replace the matrix generation workflows:
28+
* `matrix-all.yml`
29+
* `matrix-python.yml`
30+
* `matrix-exasol.yml`
31+
32+
Among all of the above, the safest way is to set the matrix-related fields in your project config object in `noxconfig.py`.
33+
34+
* Added a nox task to validate the build/test artifacts and use it in the github workflow report
35+
36+
37+
## 📚 Documentation
38+
39+
* Added new entries to the frequently asked questions regarding `multiversion documentation`
40+
41+
342
## 🐞 Fixed
443

44+
* Fixed `index.rst` documentation template to provide the correct underlining length of the main heading
545
* Added multi-version extension to Sphinx configuration of the project template

doc/faq.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,43 @@ Duplicated label error when building documentation
2323
--------------------------------------------------
2424

2525
Similar error to :code:`Warning, treated as error: integration-test-docker-environment/doc/changes/changes_0.10.0.md:5:duplicate label summary, other instance in integration-test-docker-environment/doc/changes/changes_0.1.0.md'`, might be caused by sphinx extension `sphinx.ext.autosectionlabel`. Try to remove this extension in `doc/conf.py`.
26+
27+
28+
.. _faq_multiversion_build_warnings:
29+
30+
Warning while building multiversion documentation
31+
--------------------------------------------------
32+
When running ``nox -s docs:multiversion``, I receive the following warnings during the build:
33+
34+
.. code-block::
35+
36+
WARNING: unknown config value 'smv_metadata_path' in override, ignoring
37+
WARNING: unknown config value 'smv_current_version' in override, ignoring
38+
39+
If you receive the warnings above, it is very likely that the multiversion extension is not configured in your Sphinx configuration (``conf.py``). Try adding it to your configuration and rerun the build.
40+
41+
.. code-block:: python
42+
43+
extensions = [
44+
...,
45+
...,
46+
"exasol.toolbox.sphinx.multiversion",
47+
]
48+
49+
50+
.. _faq_multiversion_selection_missing:
51+
52+
Missing Version Selection Box in Multiversion Documentation
53+
------------------------------------------------------------
54+
55+
I have run ``nox -s docs:multiversion``, but I still do not see any version selection box in the upper right corner before the GitHub symbol.
56+
57+
This is likely due to :ref:`faq_multiversion_build_warnings`
58+
59+
60+
.. _faq_multiversion_limited_versions:
61+
62+
Limited Previous Versions in Multiversion Documentation
63+
-------------------------------------------------------
64+
65+
If not all previous versions of the project are available via the version selection box of the multiversion documentation, it is likely due to the fact that the unavailable documentation for those versions was not in a compatible format (there hasn't been a compatible setup of a Sphinx-based documentation).

0 commit comments

Comments
 (0)