Change action from using docker to composite steps
2bndy5 opened this issue · comments
This will:
- improve workflow runs times from 1m 24s (currently) to 6-20s (as shown in proof-of-concept tests).
- better support for the
database
input option (which is currently broken with the docker env). - better support cross-compilation
- better support 3rd party libraries
I still want to test the database option (using a third party lib installed).
OK. that should be the last step before we release v2
I'm working on changes to the test repo that will make use of vcpkg, conan, and chocolate package managers... Just wanted to say something to report my progress. The changes will also use both windows and ubuntu runners (for the composite action).
I finally got the new CI workflow (for composite action) working on the test repo. Here's the new src/demo build process:
- Install
fmt
using conan. This results in fmt getting installed to$HOME/.conan/data/packages/
- Run cmake with vcpkg's toolchain file. This results in boost libs (namely
boost-assert
) installed to the./build/vcpkg_installed/<target triplet>
Notes
- Successful workflow log is here
- For good measure, I made sure that the demo app actually builds using the fmt and boost.assert libs, but this isn't done in the CI.
- On Windows the database can only be generated with the "NMake Makefiles" CMake generator which requires using the Visual Studio Dev prompt... There's an action for that.
Database usage
Now calling cpp-linter -p build -i build
does use the generated database, but I noticed
- The database does not include a path to the system's libc++ headers, so we see
This seems only happen on the Ubuntu runner. I think the Windows runner has already set the
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/cstddef:50:10: error: 'stddef.h' file not found [clang-diagnostic-error] #include <stddef.h>
CCFLAGS
env var due to using the VS Dev Prompt's env, but I haven't researched it locally yet (WSL is super slow when I run cmake now). - Using Windows (namely any clang version < 13), clang-tidy has trouble finding the
boost/assert.hpp
file. I have a feeling its because the VS compiler expects v13.D:\a\test-cpp-linter-action\test-cpp-linter-action\src\demo.cpp:4:10: error: 'boost/assert.hpp' file not found [clang-diagnostic-error] #include <boost/assert.hpp> // to use a third party lib (internal via vcpkg - located in build env) ^
Conclusion
I'm giving this a passing grade 💯 . Since it seems to be working for third party libs in the CI, I'm willing to work through the kinks as users report them.