Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/clang-tidy-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
shell: bash
run: |
. /entrypoint.sh
cd $GITHUB_WORKSPACE/phlex-build
cd "$GITHUB_WORKSPACE/phlex-build"

echo "➡️ Running clang-tidy checks..."
cmake --build . --target clang-tidy-check -- --export-fixes clang-tidy-fixes.yaml > clang-tidy.log 2>&1 || true
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/clang-tidy-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ jobs:
steps:
- id: parse_comment
name: Parse comment for tidy checks
env:
COMMENT_BODY: ${{ github.event.comment.body }}
run: |
checks_line=$(echo "${{ github.event.comment.body }}" | sed -nE 's/^@phlexbot[[:space:]]+tidy-fix[[:space:]]+(.*)/\1/p' | tr -d '\r')
checks_line=$(echo "$COMMENT_BODY" | sed -nE 's/^@phlexbot[[:space:]]+tidy-fix[[:space:]]+(.*)/\1/p' | tr -d '\r')
if [ -n "$checks_line" ]; then
tidy_checks=$(echo "$checks_line" | tr ',' ' ' | xargs -n1 | paste -sd, -)
echo "tidy_checks=$tidy_checks" >> $GITHUB_OUTPUT
tidy_checks="$(echo "$checks_line" | tr ',' ' ' | xargs -n1 | paste -sd, -)"
echo "tidy_checks=$tidy_checks" >> "$GITHUB_OUTPUT"
fi
- name: Get PR Info
id: get_pr
Expand Down Expand Up @@ -69,7 +71,7 @@ jobs:
PHLEX_TIDY_CHECKS: ${{ needs.parse-command.outputs.tidy_checks }}
run: |
. /entrypoint.sh
cd $GITHUB_WORKSPACE/phlex-build
cd "$GITHUB_WORKSPACE/phlex-build"

echo "Applying clang-tidy fixes using CMake target..."
cmake --build . --target clang-tidy-fix -- --export-fixes clang-tidy-fixes.yaml || true
Expand Down
32 changes: 17 additions & 15 deletions .github/workflows/cmake-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,13 @@ jobs:
needs: pre-check
if: >
needs.pre-check.result == 'success' &&
github.event_name != 'workflow_dispatch' &&
(github.event_name == 'pull_request' || github.event_name == 'push') &&
needs.pre-check.outputs.is_act != 'true'
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
outputs:
has_changes: ${{ steps.filter.outputs.matched }}
matrix: ${{ steps.generate.outputs.matrix }}

steps:
- name: Check out source code
Expand All @@ -100,8 +98,8 @@ jobs:
uses: Framework-R-D/phlex/.github/actions/detect-relevant-changes@main
with:
repo-path: phlex-src
base-ref: ${{ github.event_name == 'issue_comment' && fromJSON(needs.pre-check.outputs.pr_details).base_sha || github.event.pull_request.base.sha || github.event.before }}
head-ref: ${{ github.event_name == 'issue_comment' && fromJSON(needs.pre-check.outputs.pr_details).sha || github.event.pull_request.head.sha || github.sha }}
base-ref: ${{ github.event.pull_request.base.sha || github.event.before }}
head-ref: ${{ github.event.pull_request.head.sha || github.sha }}
file-type: |
cpp
cmake
Expand All @@ -116,25 +114,28 @@ jobs:
echo "::endgroup::"
fi

generate-matrix:
needs: pre-check
if: needs.pre-check.result == 'success'
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate.outputs.matrix }}
steps:
- id: generate
uses: Framework-R-D/phlex/.github/actions/generate-build-matrix@main
with:
user-input: ${{ github.event.inputs.build-combinations }}
comment-body: ${{ github.event.comment.body }}

build:
needs: [pre-check, detect-changes]
needs: [pre-check, detect-changes, generate-matrix]
if: >
needs.pre-check.result == 'success' &&
(
github.event_name == 'workflow_dispatch' ||
github.event_name == 'issue_comment' ||
needs.pre-check.outputs.is_act == 'true' ||
(needs.detect-changes.result == 'success' && needs.detect-changes.outputs.has_changes == 'true')
) &&
(
github.event_name != 'issue_comment' ||
github.event.comment.author_association == 'COLLABORATOR' ||
github.event.comment.author_association == 'OWNER'
)
runs-on: ubuntu-24.04
strategy:
Expand All @@ -149,7 +150,8 @@ jobs:
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
path: phlex-src
ref: ${{ github.event_name == 'issue_comment' && fromJSON(needs.build-pre-check.outputs.pr_details).sha || github.ref }}
ref: ${{ needs.pre-check.outputs.sha }}
repository: ${{ needs.pre-check.outputs.repo }}

- name: Setup build environment
uses: Framework-R-D/phlex/.github/actions/setup-build-env@main
Expand All @@ -175,11 +177,11 @@ jobs:
if: matrix.sanitizer != 'valgrind'
run: |
. /entrypoint.sh
cd $GITHUB_WORKSPACE/phlex-build
cd "$GITHUB_WORKSPACE/phlex-build"

echo "➡️ Running tests..."
echo "::group::Running ctest"
if ctest --progress --output-on-failure -j $(nproc); then
if ctest --progress --output-on-failure -j "$(nproc)"; then
echo "::endgroup::"
echo "✅ All tests passed."
else
Expand All @@ -192,7 +194,7 @@ jobs:
if: matrix.sanitizer == 'valgrind'
run: |
. /entrypoint.sh
cd $GITHUB_WORKSPACE/phlex-build
cd "$GITHUB_WORKSPACE/phlex-build"

echo "➡️ Running Valgrind tests..."
echo "::group::Running ctest -T memcheck"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:
- name: Run tests with coverage
run: |
. /entrypoint.sh
cd $GITHUB_WORKSPACE/phlex-build
cd "$GITHUB_WORKSPACE/phlex-build"

echo "➡️ Running tests with coverage..."
PROFILE_ROOT="$GITHUB_WORKSPACE/phlex-build/test/profraw"
Expand All @@ -161,7 +161,7 @@ jobs:
export LLVM_PROFILE_FILE="$PROFILE_ROOT/%m-%p.profraw"

echo "::group::Running ctest for coverage"
if ctest --progress --output-on-failure -j $(nproc); then
if ctest --progress --output-on-failure -j "$(nproc)"; then
echo "::endgroup::"
echo "✅ All tests passed."
else
Expand All @@ -176,7 +176,7 @@ jobs:
shell: bash
run: |
. /entrypoint.sh
cd $GITHUB_WORKSPACE/phlex-build
cd "$GITHUB_WORKSPACE/phlex-build"

echo "➡️ Generating coverage reports for GCC..."
echo "::group::Running coverage-gcov target"
Expand All @@ -195,7 +195,7 @@ jobs:
shell: bash
run: |
. /entrypoint.sh
cd $GITHUB_WORKSPACE/phlex-build
cd "$GITHUB_WORKSPACE/phlex-build"

echo "➡️ Generating coverage reports for Clang..."
echo "::group::Running coverage-llvm target"
Expand Down
Loading