Fix CMake test building #389
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: | |
| matrix: | |
| config: | |
| - os: ubuntu-latest | |
| vcpkg_triplet: x64-linux-release | |
| - os: macos-latest | |
| vcpkg_triplet: arm64-osx-release | |
| - os: windows-latest | |
| vcpkg_triplet: x64-windows-release | |
| 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 -E make_directory build_test | |
| cd build_test | |
| cmake ${{ steps.vcpkg.outputs.vcpkg-cmake-config }} -G "Unix Makefiles" -DWARNING_TO_ERROR=ON -Dmake_tests=ON .. | |
| - name: compile | |
| run: | | |
| cd build_test | |
| cmake --build . | |
| - name: test | |
| run: | | |
| cd build_test | |
| ctest --verbose |