Build [CMake] 🛠️ #78
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Build [CMake] 🛠️' | |
on: | |
workflow_dispatch: | |
inputs: | |
analyze-codeql: | |
required: true | |
default: true | |
type: boolean | |
description: 'Peform static analysis with CodeQL' | |
build-arm64: | |
required: false | |
default: false | |
type: boolean | |
description: 'Build ARM64 architecture' | |
install: | |
required: true | |
default: false | |
type: boolean | |
description: 'Invoke CMake install for the project' | |
test: | |
required: false | |
default: false | |
type: boolean | |
description: 'Invoke CMake CTest for the project' | |
package: | |
required: true | |
default: false | |
type: boolean | |
description: 'Invoke CMake CPack for the project' | |
publish-artifacts: | |
required: true | |
default: false | |
type: boolean | |
description: 'Publish build artifacts' | |
build-types: | |
required: true | |
# Note the string here contains a JSON array. This is later converted to an array using fromJson. | |
default: "[ 'Debug' ]" | |
type: string | |
description: 'The CMake build types (CMAKE_BUILD_TYPE) to run (must be encoded as a JSON array)' | |
workflow_call: | |
inputs: | |
build-types: | |
required: false | |
# Note the string here contains a JSON array. This is later converted to an array using fromJson. | |
default: "[ 'Debug' ]" | |
type: string | |
description: 'The CMake build type (CMAKE_BUILD_TYPE) to run.' | |
analyze-codeql: | |
required: false | |
default: true | |
type: boolean | |
build-arm64: | |
required: false | |
default: false | |
type: boolean | |
install: | |
required: false | |
default: false | |
type: boolean | |
test: | |
required: false | |
default: true | |
type: boolean | |
package: | |
required: false | |
default: false | |
type: boolean | |
publish-artifacts: | |
required: false | |
default: false | |
type: boolean | |
jobs: | |
build: | |
name: cmake build | |
permissions: | |
contents: read | |
actions: read | |
security-events: write | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { os: windows-2022 } | |
- { os: windows-2022, arch: 'ARM64' } | |
- { os: ubuntu-24.04 } | |
build-type: ${{ fromJson(inputs.build-types) }} | |
runs-on: ${{ matrix.config.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Initialize CodeQL | |
if: inputs.analyze-codeql == true | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: 'cpp' | |
- name: Build Windows | |
if: ${{ contains(matrix.config.os, 'windows') }} | |
uses: ./.github/actions/build-with-host | |
with: | |
build-type: ${{ matrix.build-type }} | |
install: ${{ inputs.install }} | |
test: ${{ inputs.test }} | |
package: ${{ inputs.package }} | |
publish-artifacts: ${{ inputs.publish-artifacts }} | |
preset-name: 'dev-windows' | |
- name: Build Linux | |
if: ${{ contains(matrix.config.os, 'ubuntu-24.04') }} | |
uses: ./.github/actions/build-with-host | |
with: | |
build-type: ${{ matrix.build-type }} | |
install: ${{ inputs.install }} | |
test: ${{ inputs.test }} | |
package: ${{ inputs.package }} | |
publish-artifacts: ${{ inputs.publish-artifacts }} | |
use-vcpkg-github-actions-cache: 'false' | |
preset-name: dev-linux | |
- name: Perform CodeQL Analysis | |
if: inputs.analyze-codeql == true | |
uses: github/codeql-action/analyze@v3 |