| 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-22.04 |
| 22 | |
| 23 | strategy: |
| 24 | matrix: |
| 25 | language: [ 'cpp' ] |
| 26 | |
| 27 | steps: |
| 28 | - uses: actions/checkout@v2 |
| 29 | with: |
| 30 | submodules: true |
| 31 | |
| 32 | - name: Initialize CodeQL |
| 33 | if: ${{ github.event.inputs.runCodeQL }} |
| 34 | uses: github/codeql-action/init@v2 |
| 35 | with: |
| 36 | languages: ${{ matrix.language }} |
| 37 | config-file: ./.github/codeql/codeql-config.yml |
| 38 | |
| 39 | - name: Install deps |
| 40 | run: sudo apt-get install -y libfontconfig1-dev libfreetype-dev libxml2-dev libssl-dev libjpeg-dev libpng-dev libtiff-dev libidn11-dev |
| 41 | |
| 42 | - name: Configure CMake |
| 43 | run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} |
| 44 | |
| 45 | - name: Build |
| 46 | run: cmake --build ${{github.workspace}}/build |
| 47 | |
| 48 | - name: Test |
| 49 | working-directory: ${{github.workspace}}/build |
| 50 | run: ctest ${{ github.event.inputs.ctestArgs }} |
| 51 | |
| 52 | - name: Perform CodeQL Analysis |
| 53 | if: ${{ github.event.inputs.runCodeQL }} |
| 54 | uses: github/codeql-action/analyze@v2 |
| 55 | with: |
| 56 | category: "/language:${{matrix.language}}" |