Skip to content

Commit 6850e97

Browse files
authored
Add backend API checks on CI (#776)
Check that the technology is not misused across the tasks (OpenMP allow usage of OpenMP API, but not TBB/std::thread, etc.)
1 parent 3d7fb4c commit 6850e97

4 files changed

Lines changed: 479 additions & 9 deletions

File tree

.github/workflows/static-analysis-pr.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- '**/*.cmake'
1212
- '**/.clang-tidy'
1313
- '.github/workflows/static-analysis-pr.yml'
14+
- 'scripts/check_task_backend_apis.py'
1415

1516
concurrency:
1617
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
@@ -162,3 +163,17 @@ jobs:
162163
done
163164
164165
echo "No linter suppression markers found in changed files."
166+
task-backend-api-check:
167+
runs-on: ubuntu-24.04
168+
steps:
169+
- uses: actions/checkout@v6
170+
with:
171+
fetch-depth: 0
172+
- name: Check task backend API usage
173+
env:
174+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
175+
HEAD_SHA: ${{ github.sha }}
176+
run: |
177+
set -euo pipefail
178+
179+
python3 scripts/check_task_backend_apis.py --base "$BASE_SHA" --head "$HEAD_SHA"

docs/locale/ru/LC_MESSAGES/user_guide/ci.po

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,12 @@ msgstr ""
106106
#: ../../../../docs/user_guide/ci.rst:23
107107
msgid ""
108108
"Security and static analysis — clang‑tidy on PRs (avoid ``NOLINT``/``IWYU"
109-
" pragma``), scheduled CodeQL (C++/Python) and OpenSSF Scorecard."
109+
" pragma``), task backend API checks, scheduled CodeQL (C++/Python) and "
110+
"OpenSSF Scorecard."
110111
msgstr ""
111112
"Безопасность и статический анализ — clang‑tidy в PR (избегайте "
112-
"``NOLINT``/``IWYU pragma``), плановые CodeQL (C++/Python) и OpenSSF "
113-
"Scorecard."
113+
"``NOLINT``/``IWYU pragma``), проверки API для backend'ов задач, плановые "
114+
"CodeQL (C++/Python) и OpenSSF Scorecard."
114115

115116
#: ../../../../docs/user_guide/ci.rst:26
116117
msgid "Diagram"
@@ -259,11 +260,13 @@ msgstr ""
259260

260261
#: ../../../../docs/user_guide/ci.rst:89
261262
msgid ""
262-
"Static analysis (clang-tidy) fails: address comments; do not use "
263-
"``NOLINT``/``IWYU pragma`` in task code."
263+
"Static analysis fails: address clang-tidy comments; do not use "
264+
"``NOLINT``/``IWYU pragma`` in task code; keep OpenMP/TBB/MPI/std::thread APIs "
265+
"in their matching task backend directories."
264266
msgstr ""
265-
"Падает статический анализ (clang-tidy): поправьте замечания; не "
266-
"используйте ``NOLINT``/``IWYU pragma`` в коде задач."
267+
"Падает статический анализ: поправьте замечания clang-tidy; не используйте "
268+
"``NOLINT``/``IWYU pragma`` в коде задач; держите API OpenMP/TBB/MPI/"
269+
"std::thread в соответствующих backend-директориях задач."
267270

268271
#: ../../../../docs/user_guide/ci.rst:90
269272
msgid ""

docs/user_guide/ci.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ High‑level pipeline
2020

2121
- Pages (docs and scoreboard) — builds Doxygen XML and Sphinx (EN+RU) + scoreboard; on ``master`` deploys with coverage to GitHub Pages.
2222

23-
- Security and static analysis — clang‑tidy on PRs (avoid ``NOLINT``/``IWYU pragma``), scheduled CodeQL (C++/Python) and OpenSSF Scorecard.
23+
- Security and static analysis — clang‑tidy on PRs (avoid ``NOLINT``/``IWYU pragma``), task backend API checks, scheduled CodeQL (C++/Python) and OpenSSF Scorecard.
2424

2525
Diagram
2626
-------
@@ -86,7 +86,7 @@ Docs and scoreboard artifacts
8686
Troubleshooting
8787
---------------
8888
- Pre-commit fails: run ``pre-commit run -a`` locally (install with ``pre-commit install``) and commit fixes.
89-
- Static analysis (clang-tidy) fails: address comments; do not use ``NOLINT``/``IWYU pragma`` in task code.
89+
- Static analysis fails: address clang-tidy comments; do not use ``NOLINT``/``IWYU pragma`` in task code; keep OpenMP/TBB/MPI/std::thread APIs in their matching task backend directories.
9090
- Tests not found/not running: verify ``settings.json`` enables required technologies and tests exist; see :doc:`submit_work`.
9191
- Time limits exceeded: reduce data sizes; prefer env vars (:doc:`environment_variables`) like ``PPC_TASK_MAX_TIME``/``PPC_PERF_MAX_TIME``; avoid sleeps/randomness.
9292
- MPI runs fail locally: set ``PPC_NUM_PROC`` and try ``--additional-mpi-args=\"--oversubscribe\"``.

0 commit comments

Comments
 (0)