Skip to content

Move "magic number" constants to config.json #4

Move "magic number" constants to config.json

Move "magic number" constants to config.json #4

Workflow file for this run

name: CMake Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Debug]
c_compiler: [gcc, cl]
include:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
exclude:
- os: windows-latest
c_compiler: gcc
- os: ubuntu-latest
c_compiler: cl
steps:
- name: Checkout without vcpkg
id: lincheckout
if: ${{ runner.os == 'Linux' }}
uses: actions/checkout@v4
- name: Checkout with vcpkg
id: wincheckout
if: ${{ runner.os == 'Windows' }}
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set up dependencies
id: depends
if: ${{ runner.os == 'Linux' }}
shell: bash
run: |
sudo wget https://apt.benthetechguy.net/benthetechguy-archive-keyring.gpg -O /usr/share/keyrings/benthetechguy-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/benthetechguy-archive-keyring.gpg] https://apt.benthetechguy.net/debian testing main contrib non-free" | sudo tee /etc/apt/sources.list.d/benthetechguy.list
sudo apt-get update
sudo apt-get install libdpp-dev libsqlite3-dev pkgconf
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}