Skip to content

Fix variable name in Valgrind script #45

Fix variable name in Valgrind script

Fix variable name in Valgrind script #45

Workflow file for this run

name: CMake build and tests
on: [ push ]
# TODO: just use CMake presets?
jobs:
build:
name: ${{ matrix.os }}-${{ matrix.build_type }}-${{ github.workflow }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build_type: [ Debug, Release ]
os: [ ubuntu-latest, windows-latest ]
include:
- os: windows-latest
vcpkg_commit_id: 'fe1e9f508ee13ed3d0a7d318beac7efe1ec4f9d7'
umb_include_meta: OFF # TODO: fix later. Boost Hana issues on MSVC.
cxx_compiler: cl
- os: ubuntu-latest
vcpkg_commit_id: 'fe1e9f508ee13ed3d0a7d318beac7efe1ec4f9d7'
umb_include_meta: ON
cxx_compiler: g++
steps:
- name: Install apt dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: autoconf-archive gcc-13 g++13 valgrind
version: 1.0 # NOTE: this is cache version according to the docs.
if: matrix.os == 'ubuntu-latest'
- name: Set default GCC
run: sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13
--slave /usr/bin/g++ g++ /usr/bin/g++-13
if: matrix.os == 'ubuntu-latest'
- name: Print GCC version
run: gcc --version
if: matrix.os == 'ubuntu-latest'
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest'
- name: Print MSVC version
run: cl.exe
if: matrix.os == 'windows-latest'
- name: Change PowerShell codepage on Windows
run: chcp 65001
if: matrix.os == 'windows-latest'
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Setup vcpkg
uses: lukka/run-vcpkg@main
id: runvcpkg
with:
vcpkgDirectory: '${{ runner.workspace }}/build/vcpkg'
vcpkgGitCommitId: '${{ matrix.vcpkg_commit_id }}'
# Run vcpkg with the command specified by the `runVcpkgFormatString` input.
runVcpkgInstall: true
vcpkgJsonGlob: '**/vcpkg.json'
- name: Print output of run-vcpkg's action.
run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' "
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake -G Ninja $GITHUB_WORKSPACE
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake
-DBUILD_TESTS=ON
-DUMB_INCLUDE_META=${{ matrix.umb_include_meta }}
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }}
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config ${{ matrix.build_type }}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{ matrix.build_type }} --verbose
- name: Print Valgrind version
run: valgrind --version
if: matrix.os == 'ubuntu-latest'
- name: Run UMB generator with Valgrind
env:
UMB_GEN_BIN: build/uscript_msgbuf_generator
run: tests/gen_test_messages_with_valgrind.sh
if: matrix.os == 'ubuntu-latest'
- name: Archive UMB generator executable
uses: actions/upload-artifact@v3
with:
name: umb-generator-executable-${{ matrix.os }}-${{ matrix.build_type }}
path: |
build/templates/
build/uscript_msgbuf_generator
build/uscript_msgbuf_generator.exe
build/*.dll