-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
130 additions
and
47 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
name: 'CMake-Build' | ||
description: 'Install Dependencies + Configure CMake + Build' | ||
inputs: | ||
path-cache: | ||
description: 'Path to vcpkg cache directory' | ||
required: true | ||
path-toolchain: | ||
description: 'Path to vcpkg tool chain file' | ||
required: true | ||
os-id: | ||
description: 'Operating System Identifier' | ||
required: true | ||
build-type: | ||
description: 'Build Configuration' | ||
required: true | ||
package: | ||
description: 'Using package manager for external dependencies' | ||
required: true | ||
platform: | ||
description: 'OS platform' | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Cache vcpkg | ||
uses: actions/cache@v3 | ||
if: inputs.package == 'ON' | ||
with: | ||
path: ${{inputs.path-cache}} | ||
key: vcpkg-x64-${{inputs.os-id}}- | ||
restore-keys: vcpkg-x64-${{inputs.os-id}}- | ||
|
||
- name: Set toolchain path | ||
shell: bash | ||
run: echo "TOOLCHAIN_PATH=${{inputs.path-toolchain}}" >> "$GITHUB_ENV" | ||
|
||
- name: Install dependencies | ||
if: inputs.package == 'ON' | ||
shell: bash | ||
run: | | ||
# We install the following packages: eigen3, catch2, cli11. Installing them with vcpkg (and caching them) | ||
# is faster than downloading and building them from source (which is the default behavior of the CZICompress-build-system). | ||
vcpkg install --triplet ${{inputs.platform}} eigen3 catch2 cli11 | ||
- name: Configure CMake | ||
shell: bash | ||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | ||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | ||
# | ||
# Instruct to use eigen3, cli11 and catch2 from vcpkg - this way the build is faster (both are installed above with vcpkg-package-manager, which is also cached). | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{inputs.build-type}} -DLIBCZI_BUILD_PREFER_EXTERNALPACKAGE_EIGEN3=${{inputs.package}} -DLIBCZI_BUILD_PREFER_EXTERNALPACKAGE_EIGEN3=${{inputs.package}} -DCZICOMPRESS_BUILD_PREFER_EXTERNALPACKAGE_CATCH2=${{inputs.package}} -DCZICOMPRESS_BUILD_PREFER_EXTERNALPACKAGE_CLI11=${{inputs.package}} -DCMAKE_TOOLCHAIN_FILE=${{inputs.path-toolchain}} -DVCPKG_TARGET_TRIPLET=${{inputs.platform}} | ||
|
||
- name: Build software | ||
shell: bash | ||
# Build your program with the given configuration | ||
run: cmake --build ${{github.workspace}}/build --config ${{inputs.build-type}} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: ["main"] | ||
schedule: | ||
- cron: "22 16 * * 4" | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: ["cpp"] | ||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
|
||
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs | ||
# queries: security-extended,security-and-quality | ||
|
||
- uses: ./.github/actions/cmake-build | ||
with: | ||
path-cache: '/usr/local/share/vcpkg/installed' | ||
path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake' | ||
os-id: 'linux' | ||
build-type: Release | ||
package: ON | ||
platform: x64-linux | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: "/language:${{matrix.language}}" |