Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change action from using docker to composite steps #88

Closed
Tracked by #87
2bndy5 opened this issue Aug 19, 2022 · 5 comments
Closed
Tracked by #87

Change action from using docker to composite steps #88

2bndy5 opened this issue Aug 19, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@2bndy5
Copy link
Collaborator

2bndy5 commented Aug 19, 2022

This will:

  1. improve workflow runs times from 1m 24s (currently) to 6-20s (as shown in proof-of-concept tests).
  2. better support for the database input option (which is currently broken with the docker env).
  3. better support cross-compilation
  4. better support 3rd party libraries
@2bndy5 2bndy5 changed the title Change action from using docker (1m 24s) to composite (6s) to greatly increase the running speed. Change action from using docker to composite steps Aug 19, 2022
@2bndy5
Copy link
Collaborator Author

2bndy5 commented Aug 19, 2022

WIP PR at #83

@2bndy5 2bndy5 added the enhancement New feature or request label Aug 19, 2022
@2bndy5
Copy link
Collaborator Author

2bndy5 commented Sep 1, 2022

I still want to test the database option (using a third party lib installed).

@shenxianpeng
Copy link
Collaborator

OK. that should be the last step before we release v2

@2bndy5
Copy link
Collaborator Author

2bndy5 commented Sep 4, 2022

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).

@2bndy5
Copy link
Collaborator Author

2bndy5 commented Sep 4, 2022

I finally got the new CI workflow (for composite action) working on the test repo. Here's the new src/demo build process:

  1. Install fmt using conan. This results in fmt getting installed to $HOME/.conan/data/packages/
  2. 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

  1. The database does not include a path to the system's libc++ headers, so we see
    /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>
    
    This seems only happen on the Ubuntu runner. I think the Windows runner has already set the 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).
  2. 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.

@2bndy5 2bndy5 closed this as completed Sep 4, 2022
@2bndy5 2bndy5 moved this from In progress to Done in cpp-linter as composite action Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

2 participants