build #131
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 | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: [master] | |
schedule: | |
- cron: '0 10 * * 5' | |
jobs: | |
main: | |
name: Build and analyze ${{ matrix.opt_modules && ' with optional modules' || '' }} (${{ matrix.language }}) | |
if: ${{ !contains(github.event.head_commit.message, 'skip-ci') }} | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
strategy: | |
fail-fast: false | |
matrix: | |
language: ['C', 'C++'] | |
opt_modules: [true, false] | |
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] | |
# Learn more about CodeQL language support at https://git.io/codeql-language-support | |
steps: | |
- | |
name: Checkout repository | |
uses: actions/checkout@v3 | |
- | |
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: Enable optional modules | |
if: ${{ matrix.opt_modules }} | |
run: | | |
echo "#define M3_USE_PMORE" >> dreambbs.conf | |
echo "#define M3_USE_PFTERM" >> dreambbs.conf | |
- | |
name: Build project | |
run: | | |
touch dreambbs.conf | |
mkdir build | |
cd build | |
cmake "-DUSE_CXX=$USE_CXX" .. | |
make | |
env: | |
USE_CXX: ${{ matrix.language == 'C++' && 'ON' || 'OFF' }} | |
- | |
name: Run tests | |
continue-on-error: true | |
run: | | |
cd build | |
make test | |
- | |
name: Perform CodeQL analysis | |
uses: github/codeql-action/analyze@v2 |