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

Add github action to run pytest on posix build #53

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

frankdarcyacn
Copy link
Contributor

This adds a github action to run integration tests on the posix build.
The ubuntu-latest runner was built with SocketCAN support but is missing the kernel module file for vcan.
Running sudo apt install linux-modules-extra-$(uname -r) adds this kernel module file, then vcan0 can be set up and the tests work.

@ThoFrank ThoFrank mentioned this pull request Jan 23, 2025
Copy link
Contributor

@marcmo marcmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shamitha-shashidhara
Copy link
Contributor

Hi @frankdarcyacn
Instead of running the Build POSIX target in the pytest workflow, we can utilize the cache from the build.yml workflow right?

@frankdarcyacn
Copy link
Contributor Author

Hi @frankdarcyacn Instead of running the Build POSIX target in the pytest workflow, we can utilize the cache from the build.yml workflow right?

Hi @shamitha-shashidhara, I see your point, yes, it should be possible to use a cached build output from another action.
But I took a look at build.yml, am I correct in thinking that it builds 6 different ways as defined by this...

      matrix:
        platform: [posix, s32k148]
        cpp-standard: [14, 17, 20]

and that it will only rebuild if particular files have changed, as defined by hashFiles below?

          key: ${{ runner.os }}-cmake-${{ matrix.platform }}-${{ matrix.cpp-standard }}-${{ hashFiles('**/*.cpp', '**/*.h',  '**/*.cmake', '**/*.txt', '**/*.c', '**/*.s', 'admin/cmake/ArmNoneEabi.cmake') }}

eg. In the this commit it looks like the builds were not rebuilt in the action run?
If so, then I think it would be safer if build.yml always builds for all targets, in case there are other file types, now or in the future, that affect the build?
Looking at build.yml makes me ask myself, should the python tests be run against the posix build with a particular cpp-standard? I presume the 3 different standards are specified just to check there are no compilation errors or warnings with any of them.
Hi @marcmo, would you have opinions on the questions above?

@marcmo
Copy link
Contributor

marcmo commented Jan 29, 2025

the 3 different standards are for making sure we build with those compilers.
we did not find a way of just running the compiler frontend without producing the object files...that would have been preferred.
The caching has to work...if we need to modify it, we should do so....
@shamitha-shashidhara @SuhashiniNaik would you please verify this?
if possible we should use the caching also for the tests of course!

@shamitha-shashidhara
Copy link
Contributor

The cache will restore builds only if there are changes in.cpp, .h,arm, or CMake files that affect posix and s32k builds. If there are changes that do not affect the build, such as documentation changes or .yml changes, the cache will reuse the output of the already existing cache, which saves time. The commit mentioned by @frankdarcyacn has only .yml changes and README updates, so the posix and s32k builds were not triggered.

@frankdarcyacn
Copy link
Contributor Author

I've updated to use the cached posix build when running pytest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants