Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
f4b4393
removed on merge group trigger - no longer relevant
Hardcode3 Apr 2, 2026
36d0881
First test for macos runners
Hardcode3 Apr 2, 2026
93401da
updated triggers to run only the action that is wip
Hardcode3 Apr 2, 2026
50555a4
trigger the workflow
Hardcode3 Apr 2, 2026
3afdb1a
oups, removed condition that was canceling the job
Hardcode3 Apr 2, 2026
b9a4ba0
added vcpkg installation
Hardcode3 Apr 2, 2026
c52ec8a
testing configure step
Hardcode3 Apr 2, 2026
9b5beea
trying to find the location of the vcpkg binary + toolchain
Hardcode3 Apr 2, 2026
858781d
test
Hardcode3 Apr 2, 2026
80c0cbc
using pre installed vcpkg
Hardcode3 Apr 2, 2026
83d2239
made coverage targets optional instead of mandatory, since it blocks …
Hardcode3 Apr 2, 2026
efcfab8
added build and test phases
Hardcode3 Apr 2, 2026
78b1067
added msvc debug to matrix since now it runs less often
Hardcode3 Apr 2, 2026
211cef6
added vcpkg caching
Hardcode3 Apr 2, 2026
62d987d
testing macos workflow with composite action to reduce code duplication
Hardcode3 Apr 2, 2026
71ff50f
moved concurrency to global scope so that matrix works correctly
Hardcode3 Apr 2, 2026
345015f
fixed typos
Hardcode3 Apr 2, 2026
ce3f14d
do not run clang release
Hardcode3 Apr 2, 2026
d64cea8
oupsi, this was a dumb mistake
Hardcode3 Apr 2, 2026
a18dd4d
testing the composite action on linux as well
Hardcode3 Apr 2, 2026
28a2ace
testing with multiple runners
Hardcode3 Apr 2, 2026
4abe6ed
trying with a different structure
Hardcode3 Apr 2, 2026
9626e79
this image was no longer supported by github
Hardcode3 Apr 2, 2026
b489dc1
renamed workflow correctly
Hardcode3 Apr 2, 2026
328dca1
refactored clang tidy action
Hardcode3 Apr 2, 2026
7c7cb00
updated linux action with new matrix system
Hardcode3 Apr 2, 2026
4493f78
updated macos action to also run on macos intel
Hardcode3 Apr 2, 2026
c529670
added more runner configurations for speed test
Hardcode3 Apr 2, 2026
3637633
fixed typo
Hardcode3 Apr 2, 2026
c311024
this job could indeed never run
Hardcode3 Apr 2, 2026
65474b5
added windows 11 arm configuration
Hardcode3 Apr 2, 2026
ec97840
fixed typos
Hardcode3 Apr 2, 2026
c66fbc7
now it should work as expected
Hardcode3 Apr 2, 2026
e8e9ce8
fixed typo?
Hardcode3 Apr 2, 2026
c80bb80
using a gate to run clang debug on push and clang release only on tag
Hardcode3 Apr 2, 2026
d83c817
removed old condition
Hardcode3 Apr 2, 2026
d02ee3d
and with a reusable workflow?
Hardcode3 Apr 2, 2026
ba49dad
fixed permissions
Hardcode3 Apr 2, 2026
f3b2951
trying dynamic matrices
Hardcode3 Apr 2, 2026
ac638b1
fixed typo
Hardcode3 Apr 2, 2026
c04660a
another typo, yessss
Hardcode3 Apr 2, 2026
d38d2c2
fixed heredoc?
Hardcode3 Apr 2, 2026
8eb6fbc
is it working now?
Hardcode3 Apr 2, 2026
5b61bd2
refactoring
Hardcode3 Apr 2, 2026
3a05af5
fixed invalid dependency between workflows
Hardcode3 Apr 2, 2026
2e8aa7a
trying to make macos runners use dynamic matrices also
Hardcode3 Apr 2, 2026
ae34429
fixed typo
Hardcode3 Apr 2, 2026
c277710
reverted on macos ci
Hardcode3 Apr 2, 2026
90fd710
added triggers for coverage badges update after pr merge
Hardcode3 Apr 2, 2026
af45510
tried preflight system to bring more info
Hardcode3 Apr 2, 2026
236336b
updated workflow names
Hardcode3 Apr 2, 2026
813d284
commented back clang tidy triggers
Hardcode3 Apr 2, 2026
8ba7bb1
Reverted windows build test
Hardcode3 Apr 2, 2026
82dc332
updated windows and macos configs
Hardcode3 Apr 2, 2026
c8e0d8c
reworked linux build and test
Hardcode3 Apr 2, 2026
e847777
Running plan linux build using a smaller machine
Hardcode3 Apr 2, 2026
dcfb92b
testing
Hardcode3 Apr 2, 2026
77e0be7
renamed reusable workflow
Hardcode3 Apr 2, 2026
107c2a9
refactored windows ci
Hardcode3 Apr 2, 2026
9475041
renamed composite action
Hardcode3 Apr 2, 2026
47ca33a
linux ci - dry
Hardcode3 Apr 2, 2026
1bae7c3
lots of tuning
Hardcode3 Apr 2, 2026
54d1986
removed clang debug configuration when using pre merge label
Hardcode3 Apr 2, 2026
20247be
here it is
Hardcode3 Apr 2, 2026
cdcbfed
simplified gating
Hardcode3 Apr 2, 2026
270562b
formatting
Hardcode3 Apr 2, 2026
335dac7
created a new preset for windows x64 arm
Hardcode3 Apr 2, 2026
1a51554
set recurrent workflows (clang debug on push) to use arm64 arch cause…
Hardcode3 Apr 2, 2026
4c4c3bf
using arm arch for clang tidy job
Hardcode3 Apr 2, 2026
8dfabad
Forgot to update Ubuntu runner type
Hardcode3 Apr 2, 2026
90bb18e
removed unnecessary arguments
Hardcode3 Apr 2, 2026
611b092
removed unecessary name matrix field
Hardcode3 Apr 2, 2026
9da14bc
small refactoring
Hardcode3 Apr 2, 2026
8f9869e
removed unecesssary test run to publish coverage
Hardcode3 Apr 2, 2026
375aa92
formatting
Hardcode3 Apr 2, 2026
59d1cf4
restored important comment
Hardcode3 Apr 2, 2026
e4d8a96
refactored setup configure and build into composite actions
Hardcode3 Apr 2, 2026
815ddfe
Merge branch 'macos_ci' of github.com:Hardcode3/BitBishop into macos_ci
Hardcode3 Apr 2, 2026
3f8c272
fixed stale cmake build cache
Hardcode3 Apr 2, 2026
e5e8fd4
hopefully fixed the issue with clang debug run and llvm coverage tool…
Hardcode3 Apr 2, 2026
cbf0499
improved cmake llvm coverage tools resolution
Hardcode3 Apr 3, 2026
10d6177
llvm tools must now be resolved directly by cmake and not by gh runner
Hardcode3 Apr 3, 2026
fa3fc1b
VCPKG_INSTALLATION_ROOT shoud exist on the runner or raise an error, …
Hardcode3 Apr 3, 2026
ea5710f
fixed all workflows triggering when setting any label event
Hardcode3 Apr 3, 2026
fb214ab
formatting
Hardcode3 Apr 3, 2026
bbe5c7e
more formatting
Hardcode3 Apr 3, 2026
c024e10
removed testing before running coverage generation since this is alre…
Hardcode3 Apr 3, 2026
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
36 changes: 36 additions & 0 deletions .github/actions/_generate_llvm_html_coverage/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Generate LLVM HTML Coverage
description: Builds the HTML coverage report for a coverage-enabled LLVM preset

inputs:
build-preset:
description: CMake build preset used to generate HTML coverage artifacts
required: true
test-preset:
description: CTest preset whose recorded coverage data should be reported
required: true

outputs:
html-cov-dir:
description: Directory containing the generated HTML coverage report
value: ${{ steps.htmlcov.outputs.html_cov_dir }}

runs:
using: composite
steps:
- id: htmlcov
shell: bash
run: |
set +e
cmake --build --preset ${{ matrix.build_preset }} --target coverage-html 2>&1 | tee coverage_html_summary.txt
COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee
set -e

HTML_COV_DIR=$(grep -Po "HTML coverage directory: \K.*" coverage_html_summary.txt)
# -P: Uses Perl-style regex.
# -o: Only outputs the matched part (not the whole line).
# \K: Tells the engine to match the string but ignore it in the final output.
# .*: Matches the rest of the line (the path)

echo "html_cov_dir=$HTML_COV_DIR" >> "$GITHUB_OUTPUT"

exit $COV_EXIT_CODE
46 changes: 46 additions & 0 deletions .github/actions/_log_to_gh_summary_bash/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CMake Bash Step With Summary
description: Runs a CMake command and logs output to GitHub Step Summary (Linux, MacOS)

inputs:
step-name:
description: Display name (e.g. Build, Configure)
required: true
command:
description: The full cmake command to run
required: true
output-file:
description: Temporary text file to store command output
required: false
default: tmp_step_output.txt

runs:
using: composite
steps:
- shell: bash
run: |
set +e
eval "${{ inputs.command }} 2>&1 | tee ${{ inputs.output-file }}"
EXIT_CODE=${PIPESTATUS[0]}
set -e

LOG_SIZE=$(wc -c < ${{ inputs.output-file }})

if [ $EXIT_CODE -eq 0 ]; then
echo "<details><summary>🟢 ${{ inputs.step-name }} Successful</summary>" >> $GITHUB_STEP_SUMMARY
else
echo "## 🔴 ${{ inputs.step-name }} Failed" >> $GITHUB_STEP_SUMMARY
fi

echo '' >> $GITHUB_STEP_SUMMARY
echo '```text' >> $GITHUB_STEP_SUMMARY

# Guard against 1MB GitHub Step Summary limit: only show the last 500 lines if it's huge
tail -n 500 ${{ inputs.output-file }} >> $GITHUB_STEP_SUMMARY

echo '```' >> $GITHUB_STEP_SUMMARY

if [ $EXIT_CODE -eq 0 ]; then
echo "</details>" >> $GITHUB_STEP_SUMMARY
fi

exit $EXIT_CODE
43 changes: 43 additions & 0 deletions .github/actions/_log_to_gh_summary_pwsh/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CMake PowerShell Step With Summary
description: Runs a command and logs output to GitHub Step Summary on Windows runners

inputs:
step-name:
description: Display name (e.g. Build, Configure)
required: true
command:
description: The full command to run
required: true
output-file:
description: Temporary text file to store command output
required: false
default: tmp_step_output.txt

runs:
using: composite
steps:
- shell: pwsh
run: |
$command = "${{ inputs.command }}"
$outputFile = "${{ inputs.output-file }}"

$global:LASTEXITCODE = 0
Invoke-Expression "$command 2>&1" | Tee-Object -FilePath $outputFile
$exitCode = if ($null -ne $LASTEXITCODE) { $LASTEXITCODE } else { 0 }

if ($exitCode -eq 0) {
Add-Content $env:GITHUB_STEP_SUMMARY "<details><summary>🟢 ${{ inputs.step-name }} Successful</summary>"
} else {
Add-Content $env:GITHUB_STEP_SUMMARY "## 🔴 ${{ inputs.step-name }} Failed"
}

Add-Content $env:GITHUB_STEP_SUMMARY ""
Add-Content $env:GITHUB_STEP_SUMMARY '```text'
Get-Content $outputFile -Tail 500 | Add-Content $env:GITHUB_STEP_SUMMARY
Add-Content $env:GITHUB_STEP_SUMMARY '```'

if ($exitCode -eq 0) {
Add-Content $env:GITHUB_STEP_SUMMARY "</details>"
}

exit $exitCode
70 changes: 70 additions & 0 deletions .github/actions/_publish_llvm_coverage/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Publish LLVM Coverage
description: Publishes the HTML coverage report and shields badges to GitHub Pages

inputs:
build-preset:
description: CMake build preset used to generate coverage artifacts
required: true
test-preset:
description: CTest preset whose recorded coverage data should be reported
required: true
github-token:
description: GitHub token used to publish the generated site
required: true
publish-branch:
description: Git branch used by GitHub Pages
required: false
default: gh-pages
publish-dir:
description: Directory prepared locally before publication
required: false
default: out

runs:
using: composite
steps:
- name: Generate html coverage report
id: htmlcov
uses: ./.github/actions/_generate_llvm_html_coverage
with:
build-preset: ${{ inputs.build-preset }}
test-preset: ${{ inputs.test-preset }}

- name: Generate shields.io badge
id: shieldsio
shell: bash
run: |
set +e
cmake --build --preset ${{ matrix.build_preset }} --target coverage-shieldsio 2>&1 | tee coverage_shieldsio_summary.txt
COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee
set -e

SHIELDSIO_REGION_COV_BADGE_FILE=$(grep -Po "Shields.io Region Coverage badge written to: \K.*" coverage_shieldsio_summary.txt)
SHIELDSIO_FUNCTION_COV_BADGE_FILE=$(grep -Po "Shields.io Function Coverage badge written to: \K.*" coverage_shieldsio_summary.txt)
SHIELDSIO_LINE_COV_BADGE_FILE=$(grep -Po "Shields.io Line Coverage badge written to: \K.*" coverage_shieldsio_summary.txt)
SHIELDSIO_BRANCH_COV_BADGE_FILE=$(grep -Po "Shields.io Branch Coverage badge written to: \K.*" coverage_shieldsio_summary.txt)

echo "SHIELDSIO_REGION_COV_BADGE_FILE=$SHIELDSIO_REGION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT"
echo "SHIELDSIO_FUNCTION_COV_BADGE_FILE=$SHIELDSIO_FUNCTION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT"
echo "SHIELDSIO_LINE_COV_BADGE_FILE=$SHIELDSIO_LINE_COV_BADGE_FILE" >> "$GITHUB_OUTPUT"
echo "SHIELDSIO_BRANCH_COV_BADGE_FILE=$SHIELDSIO_BRANCH_COV_BADGE_FILE" >> "$GITHUB_OUTPUT"

exit $COV_EXIT_CODE

- name: Prepare files
shell: bash
run: |
mkdir -p "${{ inputs.publish-dir }}/coverage/badges"
cp -r "${{ steps.htmlcov.outputs.html-cov-dir }}" "${{ inputs.publish-dir }}/coverage/"
cp "${{ steps.shieldsio.outputs.SHIELDSIO_REGION_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges"
cp "${{ steps.shieldsio.outputs.SHIELDSIO_FUNCTION_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges"
cp "${{ steps.shieldsio.outputs.SHIELDSIO_LINE_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges"
cp "${{ steps.shieldsio.outputs.SHIELDSIO_BRANCH_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges"

- name: Publish coverage badge and report to gh-pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ inputs.github-token }}
publish_branch: ${{ inputs.publish-branch }}
publish_dir: ${{ inputs.publish-dir }}
keep_files: true
115 changes: 115 additions & 0 deletions .github/actions/_setup_configure_build_linux/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Setup, Configure, and Build Linux CI
description: Configures the Linux CI environment, restores caches, and runs CMake configure/build

inputs:
arch:
description: Architecture label used in cache keys
required: true
configure-preset:
description: CMake configure preset to use
required: true
build-preset:
description: CMake build preset to use
required: true
build-target:
description: Optional CMake build target
required: false
default: ""
build-step-name:
description: Display label used in the GitHub summary for the build step
required: false
default: Build

runs:
using: composite
steps:
- name: Setup VCPKG environment
shell: bash
run: |
set -euo pipefail

if [[ -z "${VCPKG_INSTALLATION_ROOT:-}" ]]; then
echo "::error::No pre-installed vcpkg root was found on this runner."
exit 1
fi

mkdir -p \
"$GITHUB_WORKSPACE/.cache/vcpkg/downloads" \
"$GITHUB_WORKSPACE/.cache/vcpkg/archives"

{
echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT"
echo "VCPKG_DOWNLOADS=$GITHUB_WORKSPACE/.cache/vcpkg/downloads"
echo "VCPKG_DEFAULT_BINARY_CACHE=$GITHUB_WORKSPACE/.cache/vcpkg/archives"
} >> "$GITHUB_ENV"

- name: Cache VCPKG assets
uses: actions/cache@v4
with:
path: |
.cache/vcpkg/downloads
.cache/vcpkg/archives
key: ${{ runner.os }}-${{ inputs.arch }}-vcpkg-${{ inputs.build-preset }}-${{ hashFiles('vcpkg.json') }}
restore-keys: ${{ runner.os }}-${{ inputs.arch }}-vcpkg-

- name: Cache build
uses: actions/cache@v4
with:
path: build/${{ inputs.build-preset }}
key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build-preset }}-${{ hashFiles('CMakeLists.txt', 'CMakePresets.json', 'vcpkg.json', '**/*.cmake', '.github/actions/_setup_configure_build_linux/action.yaml') }}

- name: Setup LLVM tool aliases
shell: bash
run: |
set -euo pipefail

# GitHub's Ubuntu runners sometimes expose versioned LLVM binaries
# (for example `llvm-cov-18`) without the unversioned names that our
# existing CMake lookup expects. Adding a lightweight workspace-local
# aliases here instead of reinstalling LLVM packages on every run.

TOOL_BIN_DIR="$GITHUB_WORKSPACE/.local/bin"
mkdir -p "$TOOL_BIN_DIR"

ensure_llvm_tool() {
local tool="$1"

if command -v "$tool" >/dev/null 2>&1; then
return 0
fi

for suffix in 20 19 18 17 16; do
if candidate=$(command -v "${tool}-${suffix}" 2>/dev/null); then
ln -sf "$candidate" "$TOOL_BIN_DIR/$tool"
return 0
fi
done

echo "::warning::Could not find $tool or a versioned variant in PATH."
return 0
}

ensure_llvm_tool llvm-cov
ensure_llvm_tool llvm-profdata

echo "$TOOL_BIN_DIR" >> "$GITHUB_PATH"

- name: Configure (${{ inputs.configure-preset }})
uses: ./.github/actions/_log_to_gh_summary_bash
with:
step-name: Configure (${{ inputs.configure-preset }})
command: "cmake --preset ${{ inputs.configure-preset }}"

- name: Build (${{ inputs.build-preset }})
if: ${{ inputs.build-target == '' }}
uses: ./.github/actions/_log_to_gh_summary_bash
with:
step-name: ${{ inputs.build-step-name }} (${{ inputs.build-preset }})
command: "cmake --build --preset ${{ inputs.build-preset }}"

- name: Build target (${{ inputs.build-target }})
if: ${{ inputs.build-target != '' }}
uses: ./.github/actions/_log_to_gh_summary_bash
with:
step-name: ${{ inputs.build-step-name }} (${{ inputs.build-preset }})
command: "cmake --build --preset ${{ inputs.build-preset }} --target ${{ inputs.build-target }}"
79 changes: 79 additions & 0 deletions .github/actions/_setup_configure_build_macos/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Setup, Configure, and Build macOS CI
description: Configures the macOS CI environment, restores caches, and runs CMake configure/build

inputs:
arch:
description: Architecture label used in cache keys
required: true
configure-preset:
description: CMake configure preset to use
required: true
build-preset:
description: CMake build preset to use
required: true
build-target:
description: Optional CMake build target
required: false
default: ""
build-step-name:
description: Display label used in the GitHub summary for the build step
required: false
default: Build

runs:
using: composite
steps:
- name: Setup VCPKG environment
shell: bash
run: |
set -euo pipefail

if [[ -z "${VCPKG_INSTALLATION_ROOT:-}" ]]; then
echo "::error::No pre-installed vcpkg root was found on this runner."
exit 1
fi

mkdir -p \
"$GITHUB_WORKSPACE/.cache/vcpkg/downloads" \
"$GITHUB_WORKSPACE/.cache/vcpkg/archives"

{
echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT"
echo "VCPKG_DOWNLOADS=$GITHUB_WORKSPACE/.cache/vcpkg/downloads"
echo "VCPKG_DEFAULT_BINARY_CACHE=$GITHUB_WORKSPACE/.cache/vcpkg/archives"
} >> "$GITHUB_ENV"

- name: Cache VCPKG assets
uses: actions/cache@v4
with:
path: |
.cache/vcpkg/downloads
.cache/vcpkg/archives
key: ${{ runner.os }}-${{ inputs.arch }}-vcpkg-${{ inputs.build-preset }}-${{ hashFiles('vcpkg.json') }}
restore-keys: ${{ runner.os }}-${{ inputs.arch }}-vcpkg-

- name: Cache build
uses: actions/cache@v4
with:
path: build/${{ inputs.build-preset }}
key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build-preset }}-${{ hashFiles('CMakeLists.txt', 'CMakePresets.json', 'vcpkg.json', '**/*.cmake', '.github/actions/_setup_configure_build_macos/action.yaml') }}

- name: Configure (${{ inputs.configure-preset }})
uses: ./.github/actions/_log_to_gh_summary_bash
with:
step-name: Configure (${{ inputs.configure-preset }})
command: "cmake --preset ${{ inputs.configure-preset }}"

- name: Build (${{ inputs.build-preset }})
if: ${{ inputs.build-target == '' }}
uses: ./.github/actions/_log_to_gh_summary_bash
with:
step-name: ${{ inputs.build-step-name }} (${{ inputs.build-preset }})
command: "cmake --build --preset ${{ inputs.build-preset }}"

- name: Build target (${{ inputs.build-target }})
if: ${{ inputs.build-target != '' }}
uses: ./.github/actions/_log_to_gh_summary_bash
with:
step-name: ${{ inputs.build-step-name }} (${{ inputs.build-preset }})
command: "cmake --build --preset ${{ inputs.build-preset }} --target ${{ inputs.build-target }}"
Loading
Loading