fix: resolve CI/CD action file issues and add Windows build presets

- Fix .gitignore overly broad 'build*/' pattern that was ignoring .github/actions/build-project/
- Add missing build-project action file to repository
- Add comprehensive Windows CMake presets (win-dbg, win-rel, win-ai, win-vs-*, etc.)
- Add windows-base and windows-vs-base hidden presets for Ninja and Visual Studio generators
- Remove needs: build dependency from test job to allow parallel testing
- Support both x64 and ARM64 Windows architectures
- Configure MSVC runtime library settings for static linking

Fixes GitHub Actions errors: 'Can't find action.yml under build-project'
This commit is contained in:
scawful
2025-11-01 11:09:26 -04:00
parent 25a0fb6d3a
commit 6618b90b51
3 changed files with 63 additions and 6 deletions

View File

@@ -0,0 +1,58 @@
name: 'Build Project'
description: 'Build the project with CMake and caching'
inputs:
platform:
description: 'Target platform (linux, macos, windows)'
required: true
preset:
description: 'CMake preset to use'
required: true
build-type:
description: 'Build type (Debug, Release, RelWithDebInfo)'
required: false
default: 'RelWithDebInfo'
runs:
using: 'composite'
steps:
- name: Cache build artifacts
uses: actions/cache@v4
with:
path: build
key: build-${{ inputs.platform }}-${{ github.sha }}
restore-keys: |
build-${{ inputs.platform }}-
- name: Configure project
shell: bash
run: |
cmake --preset "${{ inputs.preset }}"
- name: Build project (Linux/macOS)
if: inputs.platform != 'windows'
shell: bash
run: |
if command -v nproc >/dev/null 2>&1; then
CORES=$(nproc)
elif command -v sysctl >/dev/null 2>&1; then
CORES=$(sysctl -n hw.ncpu)
else
CORES=2
fi
echo "Using $CORES parallel jobs"
cmake --build build --parallel "$CORES"
- name: Build project (Windows)
if: inputs.platform == 'windows'
shell: pwsh
run: |
$JOBS = ${env:CMAKE_BUILD_PARALLEL_LEVEL:-4}
echo "Using $JOBS parallel jobs"
cmake --build build --config "${{ inputs.build-type }}" --parallel "$JOBS"
- name: Show build artifacts
shell: bash
run: |
echo "Build artifacts:"
find build -name "*.exe" -o -name "yaze" -o -name "*.app" | head -10

View File

@@ -98,7 +98,6 @@ jobs:
test:
name: "Test - ${{ matrix.name }}"
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false

10
.gitignore vendored
View File

@@ -1,8 +1,8 @@
# Build directories - organized by platform
build/
build-*/
out/
build*/
# Build directories - organized by platform (root level only)
/build/
/build-*/
/build_*/
/out/
docs/html/
docs/latex/