From 99beaa9b751d932df323a9144c228bf85fd10dca Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Sat, 23 Dec 2023 00:15:49 -0300 Subject: [PATCH 1/3] Add problem matcher for test-translations.yml --- .github/sphinx_lint_matcher.json | 15 +++++++++++++++ .github/workflows/test-translations.yml | 9 +++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 .github/sphinx_lint_matcher.json diff --git a/.github/sphinx_lint_matcher.json b/.github/sphinx_lint_matcher.json new file mode 100644 index 000000000..41896d8f1 --- /dev/null +++ b/.github/sphinx_lint_matcher.json @@ -0,0 +1,15 @@ +{ + "problemMatcher": [ + { + "owner": "sphinx-lint-problem-matcher", + "pattern": [ + { + "regexp": "^(.*):(\\d+):\\s+(.*)$", + "file": 1, + "line": 2, + "message": 3 + } + ] + } + ] +} diff --git a/.github/workflows/test-translations.yml b/.github/workflows/test-translations.yml index 50f2dd067..d6feddac0 100644 --- a/.github/workflows/test-translations.yml +++ b/.github/workflows/test-translations.yml @@ -58,7 +58,7 @@ jobs: ref: ${{ env.I18N_BRANCH }} - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: >- 3.10 @@ -66,8 +66,13 @@ jobs: - name: Install Python tooling run: python -m pip install --upgrade nox virtualenv sphinx-lint + - name: Set Sphinx problem matcher + uses: sphinx-doc/github-problem-matcher@master + - name: Build translated docs in ${{ matrix.language }} run: nox -s build -- -q -D language=${{ matrix.language }} - name: Lint translation file - run: sphinx-lint locales/${{ matrix.language }}/LC_MESSAGES/messages.po + run: | + echo '::add-matcher::.github/sphinx_lint_matcher.json' + sphinx-lint locales/${{ matrix.language }}/LC_MESSAGES/messages.po From 86eb51d6662362cbbf0c2dd70b26a9587977cf41 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Wed, 3 Jan 2024 10:11:00 -0300 Subject: [PATCH 2/3] Pin github-problem-matcher version to v1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) --- .github/workflows/test-translations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-translations.yml b/.github/workflows/test-translations.yml index d6feddac0..5a61b431b 100644 --- a/.github/workflows/test-translations.yml +++ b/.github/workflows/test-translations.yml @@ -67,7 +67,7 @@ jobs: run: python -m pip install --upgrade nox virtualenv sphinx-lint - name: Set Sphinx problem matcher - uses: sphinx-doc/github-problem-matcher@master + uses: sphinx-doc/github-problem-matcher@v1.0 - name: Build translated docs in ${{ matrix.language }} run: nox -s build -- -q -D language=${{ matrix.language }} From 0145ba51be2b610acfc1408beb97f02b53fca7f7 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Wed, 3 Jan 2024 10:24:54 -0300 Subject: [PATCH 3/3] Split steps for add-matcher and lint commands --- .github/workflows/test-translations.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-translations.yml b/.github/workflows/test-translations.yml index 5a61b431b..45dc60aa3 100644 --- a/.github/workflows/test-translations.yml +++ b/.github/workflows/test-translations.yml @@ -72,7 +72,10 @@ jobs: - name: Build translated docs in ${{ matrix.language }} run: nox -s build -- -q -D language=${{ matrix.language }} + - name: Set Sphinx Lint problem matcher + if: always() + run: echo '::add-matcher::.github/sphinx_lint_matcher.json' + - name: Lint translation file - run: | - echo '::add-matcher::.github/sphinx_lint_matcher.json' - sphinx-lint locales/${{ matrix.language }}/LC_MESSAGES/messages.po + if: always() + run: sphinx-lint locales/${{ matrix.language }}/LC_MESSAGES/messages.po