Skip to content

CMake: add CI testing #13477

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

Merged
merged 6 commits into from
Oct 30, 2020
Merged

CMake: add CI testing #13477

merged 6 commits into from
Oct 30, 2020

Conversation

jamesbeyond
Copy link
Contributor

@jamesbeyond jamesbeyond commented Aug 23, 2020

Summary of changes

  • added a new examples_cmake.json for describing which example can build with cmake on which targets
  • improved example.py let it support both cmake build and legency tools build

Impact of changes

Migration actions required

Documentation


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@ciarmcom
Copy link
Member

@jamesbeyond, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@mbed-ci
Copy link

mbed-ci commented Aug 23, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-ARM ✔️
jenkins-ci/mbed-os-ci_build-GCC_ARM ✔️

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 24, 2020

I've checked the logs, there are only unit tests.

@jamesbeyond
Copy link
Contributor Author

jamesbeyond commented Aug 24, 2020

I've checked the logs, there are only unit tests.

Hi @0xc0170 , this is just for demo purpose, in the PR, I want to show that we can customize our CI pipeline, to a different flow/testing set on a particular branch, which is totally different from the master branch one.
This is the request from @Patater, I'll talk with him later regarding this.

@mbed-ci
Copy link

mbed-ci commented Aug 24, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 2 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_build-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-ARM ✔️
jenkins-ci/mbed-os-ci_unittests ✔️

@mergify
Copy link

mergify bot commented Aug 24, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@hugueskamba hugueskamba force-pushed the feature-cmake branch 2 times, most recently from 05cd574 to fa7523f Compare August 28, 2020 13:03
@mergify
Copy link

mergify bot commented Aug 28, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@mergify
Copy link

mergify bot commented Sep 2, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@hugueskamba hugueskamba force-pushed the feature-cmake branch 2 times, most recently from 8e34f86 to c7322d8 Compare September 7, 2020 20:42
@jamesbeyond jamesbeyond force-pushed the dummy_cmake branch 2 times, most recently from 1d130e5 to d2a8b8b Compare September 10, 2020 16:49
@mbed-ci
Copy link

mbed-ci commented Sep 10, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 3 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️

@mbed-ci
Copy link

mbed-ci commented Sep 10, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 4 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️

@mbed-ci
Copy link

mbed-ci commented Sep 10, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 5 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️

@mbed-ci
Copy link

mbed-ci commented Sep 11, 2020

Jenkins CI Test : ❌ FAILED

Build Number: 6 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_cmake-example-ARM
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM
jenkins-ci/mbed-os-ci_unittests ✔️

@mbed-ci
Copy link

mbed-ci commented Sep 11, 2020

Jenkins CI Test : ❌ FAILED

Build Number: 7 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM
jenkins-ci/mbed-os-ci_cmake-example-ARM
jenkins-ci/mbed-os-ci_unittests ✔️

@ladislas
Copy link
Contributor

ladislas commented Oct 28, 2020

We are currently having issue with Travis being slow - lot of pending jobs (CMake jobs do not help as they take a lot of time and this won't scale anyway). As there are changes requested above, please also add a commit removing Travis CMake build job.

@0xc0170 I haven't looked into your Travis CI configuration, but I was having the same issue with our custom CI using CMake and rebuilding everything from scratch (we're using Github Actions).

We've added ccache to our build system and main CMakeLists.txt and now build that used to take ~10min on an old MacBook Pro 2015 take between 30seconds and 2minutes depending on how much there is to rebuild. Even changing target and running from scratch still benefits from ccache.

EDIT: my bad, it's already active, should I've looked before :)

- ${HOME}/.ccache

@ladislas
Copy link
Contributor

@0xc0170 that being said, I can't find where it's called with cmake... am I missing something?

we have the following at the top our main CMakeLists.txt:

find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
	set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
endif()

All the commands run through ccache.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 28, 2020

@ladislas That is another thing to look at (we do not yet use ccache with CMake). Please send a PR adding it

@mbed-ci
Copy link

mbed-ci commented Oct 28, 2020

Jenkins CI Test : ❌ FAILED

Build Number: 27 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM
jenkins-ci/mbed-os-ci_cmake-example-ARM

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 28, 2020

Configuration error (python cant find a path for BLe example) ?

Edit: found it, read below

"BLE_GattClient",
"BLE_GattServer",
"BLE_HeartRate",
"BLE_LED",
Copy link
Contributor

Choose a reason for hiding this comment

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

We currently support only BLE_LED, please remove the rest

@mbed-ci
Copy link

mbed-ci commented Oct 28, 2020

Jenkins CI Test : ❌ FAILED

Build Number: 28 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 29, 2020

Another thing to consider - ARMCLang will fail for our examples if we use older CMake version than 3.19.0 (currently only rc2 is out). This was found during #13827. To unblock 13827, we need this PR first.

Please install the latest CMake (3.19.0rc2, so ARMClang will compile).

Also another fix landed to feature-cmake (previouso ARM failures), feature-cmake should work once the latest cmake is used. Let's update and restart CI.

@mbed-ci
Copy link

mbed-ci commented Oct 29, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 29 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 29, 2020

Looks like its ready, shout now or will merge to the feature branch soon.

@mbed-ci
Copy link

mbed-ci commented Oct 29, 2020

Jenkins CI Test : ❌ FAILED

Build Number: 30 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️

@jamesbeyond
Copy link
Contributor Author

GitHub hiccups , cause CI failed to clone repo. restart CI

Comment on lines +389 to +391
if profiles:
for profile in profiles:
build_command_seq[0] += " --profile {}".format(profile)
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can also test all build profiles with mbed-tools.
You can use the --build-type optional argument of the build sub-command.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cheers, good to know that.
But I as mentioned in Jaeden's comment, we are not going to introduce build multiple profile at this PR, as this will evolve more CI side code changes. We'll do that as an improvement in near future. In this PR we are only build the default profile which is development for now

@mbed-ci
Copy link

mbed-ci commented Oct 29, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 31 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️

@0xc0170 0xc0170 merged commit 014dbce into ARMmbed:feature-cmake Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants