Fix CMake test building #390
Workflow file for this run
This file contains hidden or 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 Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| - gh-workflows | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| env: | |
| PLATFORM: posix | |
| TESTS: yes | |
| jobs: | |
| build-linux-autotools: | |
| name: Build for Linux using Autotools | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| CC: ["gcc", "clang" ] | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v3 | |
| - name: setup | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: libcunit1-dev libtool libtool-bin exuberant-ctags valgrind | |
| version: 1.0 | |
| - name: configure | |
| run: | | |
| # mkdir build-${{matrix.CC}} | |
| # cd build-${{matrix.CC}} | |
| $GITHUB_WORKSPACE/autogen.sh | |
| $GITHUB_WORKSPACE/configure --enable-tests | |
| - name: compile | |
| run: | | |
| # cd build-${{matrix.CC}} | |
| make EXTRA_CFLAGS=-Werror | |
| - name: tests | |
| run: | | |
| # cd build-${{matrix.CC}} | |
| libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet tests/unit-tests/testdriver | |
| libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet tests/ccm-test | |
| build-cmake: | |
| name: Build using CMake | |
| runs-on: ${{ matrix.config.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - os: ubuntu-latest | |
| vcpkg_triplet: x64-linux-release | |
| compiler: "Unix Makefiles" | |
| - os: macos-latest | |
| vcpkg_triplet: arm64-osx-release | |
| compiler: "Unix Makefiles" | |
| - os: windows-latest | |
| vcpkg_triplet: x64-windows-release | |
| compiler: "Unix Makefiles" | |
| - os: windows-latest | |
| vcpkg_triplet: x64-windows-release | |
| compiler: "Visual Studio 17 2022" | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v3 | |
| - name: setup | |
| uses: johnwason/vcpkg-action@v7 | |
| id: vcpkg | |
| with: | |
| pkgs: cunit | |
| triplet: ${{ matrix.config.vcpkg_triplet }} | |
| cache-key: ${{ matrix.config.os }} | |
| token: ${{ github.token }} | |
| - name: configure | |
| run: cmake ${{ steps.vcpkg.outputs.vcpkg-cmake-config }} -G "${{ matrix.config.compiler }}" -DWARNING_TO_ERROR=ON -Dmake_tests=ON -B build_test | |
| - name: compile | |
| run: cmake --build build_test | |
| - name: test | |
| working-directory: build_test | |
| run: ctest -C Debug --verbose |