From bb18fb03bf2b0a36d75cb97d633d6cf014dc180d Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Thu, 27 Jun 2024 09:43:23 +0200 Subject: [PATCH 1/4] Use rstcheck to "lint" the README --- .github/workflows/tests.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cdd881fbe19..d8fb8cb1d1b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -72,6 +72,7 @@ jobs: - 'pyproject.toml' - 'poetry.lock' - '.github/workflows/tests.yml' + - 'README.rst' check-sampleconfig: runs-on: ubuntu-latest @@ -269,6 +270,20 @@ jobs: - run: cargo fmt --check + # This is to detect issues with the rst file, which can otherwise cause issues + # when uploading packages to PyPi. + lint-readme: + runs-on: ubuntu-latest + needs: changes + if: ${{ needs.changes.outputs.linting == 'true' }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + - run: "pip install rstcheck" + - run: "rstcheck --report-level=WARNING README.rst" + # Dummy step to gate other tests on without repeating the whole list linting-done: if: ${{ !cancelled() }} # Run this even if prior jobs were skipped @@ -284,6 +299,7 @@ jobs: - lint-clippy - lint-clippy-nightly - lint-rustfmt + - lint-readme runs-on: ubuntu-latest steps: - uses: matrix-org/done-action@v2 From fcaadc9e9363c4659295a8690b02d873da7ec7b5 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Thu, 27 Jun 2024 09:48:14 +0200 Subject: [PATCH 2/4] Changelog --- changelog.d/17367.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/17367.misc diff --git a/changelog.d/17367.misc b/changelog.d/17367.misc new file mode 100644 index 00000000000..361731b8ae7 --- /dev/null +++ b/changelog.d/17367.misc @@ -0,0 +1 @@ +Add CI check for the README. \ No newline at end of file From 55af4b40afebff34c4e6f8c64284c54a2ebeb79f Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Thu, 27 Jun 2024 11:59:02 +0200 Subject: [PATCH 3/4] Add separate group for readme linting --- .github/workflows/tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d8fb8cb1d1b..9f820982434 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,6 +21,7 @@ jobs: trial: ${{ !startsWith(github.ref, 'refs/pull/') || steps.filter.outputs.trial }} integration: ${{ !startsWith(github.ref, 'refs/pull/') || steps.filter.outputs.integration }} linting: ${{ !startsWith(github.ref, 'refs/pull/') || steps.filter.outputs.linting }} + linting_readme: ${{ !startsWith(github.ref, 'refs/pull/') || steps.filter.outputs.linting_readme }} steps: - uses: dorny/paths-filter@v3 id: filter @@ -72,6 +73,8 @@ jobs: - 'pyproject.toml' - 'poetry.lock' - '.github/workflows/tests.yml' + + linting_readme: - 'README.rst' check-sampleconfig: @@ -275,7 +278,7 @@ jobs: lint-readme: runs-on: ubuntu-latest needs: changes - if: ${{ needs.changes.outputs.linting == 'true' }} + if: ${{ needs.changes.outputs.linting_readme == 'true' }} steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 From 7d68c5e4734ee067a3e5d03392083cc7a562da7c Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Thu, 27 Jun 2024 12:04:27 +0200 Subject: [PATCH 4/4] lint-readme may be skipped --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9f820982434..2cc5a525a6a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -320,6 +320,7 @@ jobs: lint-clippy lint-clippy-nightly lint-rustfmt + lint-readme calculate-test-jobs: