switch google test to system provided one #30
Workflow file for this run
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 and Test | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-24.04 | |
env: | |
CC: gcc-14 | |
CXX: g++-14 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgmock-dev | |
- name: Print env | |
run: | | |
echo github.event.action: ${{ github.event.action }} | |
echo github.event_name: ${{ github.event_name }} | |
cmake --version | |
$CC --version | |
$CXX --version | |
# - name: Build gtest | |
# run: | | |
# cd /usr/src/gtest | |
# ls | |
# sudo mkdir build && cd build | |
# sudo cmake .. | |
# sudo make | |
# ls | |
# ls lib | |
# sudo cp lib/libgtest* /usr/lib/ | |
# sudo cp lib/libgmock* /usr/lib/ | |
# sudo mkdir /usr/local/lib/googletest | |
# sudo ln -s /usr/lib/libgtest.a /usr/local/lib/googletest/libgtest.a | |
# sudo ln -s /usr/lib/libgtest_main.a /usr/local/lib/googletest/libgtest_main.a | |
# sudo ln -s /usr/lib/libgmock.a /usr/local/lib/googletest/libgmock.a | |
# sudo ln -s /usr/lib/libgmock_main.a /usr/local/lib/googletest/libgmock_main.a | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build | |
- name: Build binary | |
run: cmake --build ${{github.workspace}}/build --target vgraph | |
- name: Binary can be started | |
working-directory: ${{github.workspace}}/build | |
run: ./vgraph -h | |
- name: Build unit tests | |
run: cmake --build ${{github.workspace}}/build --target vgraph_test | |
- name: Run unit tests | |
working-directory: ${{github.workspace}}/build | |
run: ./vgraph_test |