| 1 |
name: build-linux |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [ master ] |
| 6 |
pull_request: |
| 7 |
branches: [ master ] |
| 8 |
workflow_dispatch: |
| 9 |
inputs: |
| 10 |
ctestArgs: |
| 11 |
description: 'CTest arguments' |
| 12 |
runCodeQL: |
| 13 |
description: 'Run CodeQL analysis' |
| 14 |
type: boolean |
| 15 |
|
| 16 |
env: |
| 17 |
BUILD_TYPE: Release |
| 18 |
|
| 19 |
jobs: |
| 20 |
build: |
| 21 |
runs-on: ubuntu-latest |
| 22 |
|
| 23 |
strategy: |
| 24 |
matrix: |
| 25 |
language: [ 'cpp' ] |
| 26 |
|
| 27 |
steps: |
| 28 |
- uses: actions/checkout@v6 |
| 29 |
with: |
| 30 |
submodules: true |
| 31 |
|
| 32 |
- name: Initialize CodeQL |
| 33 |
if: ${{ github.event.inputs.runCodeQL }} |
| 34 |
uses: github/codeql-action/init@v4 |
| 35 |
with: |
| 36 |
languages: ${{ matrix.language }} |
| 37 |
config-file: ./.github/codeql/codeql-config.yml |
| 38 |
|
| 39 |
- name: Install deps |
| 40 |
run: | |
| 41 |
sudo apt update |
| 42 |
sudo apt install -y libfontconfig1-dev libfreetype-dev libxml2-dev libssl-dev libjpeg-dev libpng-dev libtiff-dev |
| 43 |
|
| 44 |
- name: Configure CMake |
| 45 |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} |
| 46 |
|
| 47 |
- name: Build |
| 48 |
run: cmake --build ${{github.workspace}}/build |
| 49 |
|
| 50 |
- name: Test |
| 51 |
working-directory: ${{github.workspace}}/build |
| 52 |
run: ctest ${{ github.event.inputs.ctestArgs }} |
| 53 |
|
| 54 |
- name: Perform CodeQL Analysis |
| 55 |
if: ${{ github.event.inputs.runCodeQL }} |
| 56 |
uses: github/codeql-action/analyze@v4 |
| 57 |
with: |
| 58 |
category: "/language:${{matrix.language}}" |