diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38e86ce..57244ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,14 +18,28 @@ jobs: - '20' steps: - uses: actions/checkout@v4 - - name: restore + - name: install GoogleTest run: | sudo apt-get update sudo apt-get install -y libgtest-dev + - name: install include-what-you-use (iwyu) + # NB: https://packages.ubuntu.com/jammy/iwyu apparently doesn't declare the `libclang-common-XXX-dev` package it + # needs as a dependency (without it, `include-what-you-use` fails with "fatal error: 'stddef.h' file not found" + # or similar), although this problem has been reported in 7 out of 7 bug reports at + # https://bugs.launchpad.net/ubuntu/+source/iwyu, the oldest one is from 2014. + # + # We intentionally specify an exact version of `iwyu` here, so that when a new version becomes available and we + # want to update to it, we'll have to change this hardcoded version manually and update the + # `libclang-common-XXX-dev` version accordingly (see + # https://github.com/include-what-you-use/include-what-you-use/blob/master/README.md#clang-compatibility). + run: sudo apt-get install -y iwyu=8.17-1 libclang-common-13-dev - name: build env: CPP_STANDARD: ${{ matrix.cpp-standard }} - run: .build/build -DCMAKE_CXX_STANDARD="$CPP_STANDARD" -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_CXX_EXTENSIONS=OFF + run: | + .build/build \ + -DCMAKE_CXX_STANDARD="$CPP_STANDARD" -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_CXX_EXTENSIONS=OFF \ + -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE='include-what-you-use;-Xiwyu;--verbose=3' - name: unittest run: .build/run-unittest