mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-24 02:20:37 +00:00
Pin all external GitHub Actions to full commit SHAs and upgrade to their latest major versions to reduce supply chain attack surface: - actions/checkout: v3/v4/v5 -> v6.0.2 - actions/github-script: v7 -> v8.0.0 - actions/setup-python: v5 -> v6.2.0 - actions/upload-artifact: v4 -> v7.0.0 - astral-sh/setup-uv: v6 -> v8.0.0 - mheap/github-action-required-labels: v5.5.2 (pinned) - redhat-plumbers-in-action/differential-shellcheck: v5.5.6 (pinned) - codespell-project/actions-codespell: v2.2 (pinned, was @master) Set FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true in all 21 workflows that use JavaScript-based actions to opt into the Node.js 24 runtime now. This resolves the deprecation warning: "Node.js 20 actions are deprecated. Please check if updated versions of these actions are available that support Node.js 24. Actions will be forced to run with Node.js 24 by default starting June 2nd, 2026. Node.js 20 will be removed from the runner on September 16th, 2026." See: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/ scylladb/github-automation references are intentionally left at @main as they are org-internal reusable workflows. Fixes: SCYLLADB-1410 Backport: Backport is required for live branches that run GH actions: 2026.1, 2025.4, 2025.1 and 2024.1 Closes scylladb/scylladb#29421
105 lines
3.9 KiB
YAML
105 lines
3.9 KiB
YAML
name: iwyu
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
env:
|
|
BUILD_TYPE: RelWithDebInfo
|
|
BUILD_DIR: build
|
|
CLEANER_OUTPUT_PATH: build/clang-include-cleaner.log
|
|
# the "idl" subdirectory does not contain C++ source code. the .hh files in it are
|
|
# supposed to be processed by idl-compiler.py, so we don't check them using the cleaner
|
|
CLEANER_DIRS: test/unit exceptions alternator api auth cdc compaction db dht gms index lang message mutation mutation_writer node_ops raft redis replica service
|
|
SEASTAR_BAD_INCLUDE_OUTPUT_PATH: build/seastar-bad-include.log
|
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
# cancel the in-progress run upon a repush
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
read-toolchain:
|
|
uses: ./.github/workflows/read-toolchain.yaml
|
|
clang-include-cleaner:
|
|
name: "Analyze #includes in source files"
|
|
needs:
|
|
- read-toolchain
|
|
runs-on: ubuntu-latest
|
|
container: ${{ needs.read-toolchain.outputs.image }}
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
submodules: true
|
|
- name: Generate compilation database
|
|
run: |
|
|
cmake \
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
-DCMAKE_C_COMPILER=clang \
|
|
-DCMAKE_CXX_COMPILER=clang++ \
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
|
-G Ninja \
|
|
-B $BUILD_DIR \
|
|
-S .
|
|
- run: |
|
|
cmake \
|
|
--build $BUILD_DIR \
|
|
--target wasmtime_bindings
|
|
- name: Build headers
|
|
run: |
|
|
swagger_targets=''
|
|
for f in api/api-doc/*.json; do
|
|
if test "${f#*.}" = json; then
|
|
name=$(basename "$f" .json)
|
|
if test $name != swagger20_header; then
|
|
swagger_targets+=" scylla_swagger_gen_$name"
|
|
fi
|
|
fi
|
|
done
|
|
cmake \
|
|
--build build \
|
|
--target seastar_http_request_parser \
|
|
--target idl-sources \
|
|
--target $swagger_targets
|
|
- run: |
|
|
echo "::add-matcher::.github/clang-include-cleaner.json"
|
|
- name: clang-include-cleaner
|
|
run: |
|
|
for d in $CLEANER_DIRS; do
|
|
find $d -name '*.cc' -o -name '*.hh' \
|
|
-exec echo {} \; \
|
|
-exec clang-include-cleaner \
|
|
--ignore-headers=seastarx.hh \
|
|
--print=changes \
|
|
-p $BUILD_DIR \
|
|
{} \; | tee --append $CLEANER_OUTPUT_PATH
|
|
done
|
|
- run: |
|
|
echo "::remove-matcher owner=clang-include-cleaner::"
|
|
- run: |
|
|
echo "::add-matcher::.github/seastar-bad-include.json"
|
|
- name: check for seastar includes
|
|
run: |
|
|
git -c safe.directory="$PWD" \
|
|
grep -nE '#include +"seastar/' \
|
|
| tee "$SEASTAR_BAD_INCLUDE_OUTPUT_PATH"
|
|
- run: |
|
|
echo "::remove-matcher owner=seastar-bad-include::"
|
|
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
with:
|
|
name: Logs
|
|
path: |
|
|
${{ env.CLEANER_OUTPUT_PATH }}
|
|
${{ env.SEASTAR_BAD_INCLUDE_OUTPUT_PATH }}
|
|
- name: fail if seastar headers are included as an internal library
|
|
run: |
|
|
if [ -s "$SEASTAR_BAD_INCLUDE_OUTPUT_PATH" ]; then
|
|
echo "::error::Found #include \"seastar/ in the source code. Use angle brackets instead."
|
|
exit 1
|
|
fi
|