Skip to content

Translated using Weblate (German) #277

Translated using Weblate (German)

Translated using Weblate (German) #277

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Analysis"
on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '41 15 * * 5'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
env:
CMAKE_BUILD_TYPE: Release
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
config:
- name: Ubuntu
os: ubuntu-latest
arch: x86_64 # as reported by `arch` or `uname -m`
compiler_cache: ccache
compiler_cache_path: ~/.ccache
language: 'cpp' # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
vcpkg_binary_cache: ~/.cache/vcpkg
vcpkg_triplet: x64-linux
wxwidgets_git_url: https://github.com/wxWidgets/wxWidgets.git
wxwidgets_git_ref: v3.1.5
WX_CONFIG: /home/runner/work/tenacity/tenacity/wxwidgets-install/bin/wx-config
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: Install dependencies
run: |
exec bash "scripts/ci/dependencies.sh"
- name: Get Git commit of vcpkg submodule
run: echo VCPKG_COMMIT=$(git ls-tree HEAD vcpkg | awk '{print $3}') >> ${GITHUB_ENV}
- name: "Set up wxWidgets cache"
uses: actions/cache@v3
id: wxwidgets-cache
with:
path: ${{ github.workspace }}/wxwidgets-install
key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ matrix.config.wxwidgets_git_url }}-${{ matrix.config.wxwidgets_git_ref }}
# FIXME: use wxWidgets from vcpkg for all OSes when bugs are fixed for Linux and macOS
# https://github.com/microsoft/vcpkg/pull/17111
- name: Build and install wxWidgets
if: steps.wxwidgets-cache.outputs.cache-hit != 'true' && runner.os != 'Windows'
run: |
# wxWidgets' build system does not find dependencies from vcpkg, so use its vendored Git submodules
git clone --recurse-submodules ${{ matrix.config.wxwidgets_git_url }}
cd wxWidgets
git checkout ${{ matrix.config.wxwidgets_git_ref }}
cmake -G Ninja -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/wxwidgets-install \
-S . -B cmake_build
cmake --build cmake_build
cmake --install cmake_build
- name: "Set up compiler cache"
uses: actions/cache@v3
with:
path: ${{ matrix.config.compiler_cache_path }}
key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}-${{ github.run_number }}
restore-keys: |
${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}-
${{ matrix.config.os }}-${{ matrix.config.arch }}-
- name: Configure
run: >-
cmake
-G Ninja
-D CMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }}
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/build/install
-D VCPKG=ON
-S .
-B build
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
# hack to get CMake to find wxWidgets until vcpkg wxWidgets port is fixed
# https://github.com/microsoft/vcpkg/pull/17111
WX_CONFIG: ${{ matrix.config.WX_CONFIG }}
# 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.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
- name: Build
run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} --verbose
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2