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

Work CI-CD #2983

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

Work CI-CD #2983

wants to merge 2 commits into from

Conversation

josesimoes
Copy link
Member

@josesimoes josesimoes commented Jul 23, 2024

Description

  • Add ccache to all platforms.
  • Adjust AZDO pipeline yamls.
  • Add PS1 to install install ccache.

Motivation and Context

  • Decrease pipeline builds.

How Has This Been Tested?

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dev Containers (changes related with Dev Containers, has no impact on code or features)
  • Dependencies/declarations (update dependencies or assembly declarations and changes associated, has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).

Summary by CodeRabbit

  • New Features

    • Enhanced build processes with caching mechanisms for improved compilation speed across multiple targets.
    • Introduced caching tasks for managing ccache files, optimizing build performance.
  • Bug Fixes

    • Improved handling of cache restoration failures to ensure necessary tools are available.
  • Documentation

    • Updated Azure Pipelines configuration files to reflect new caching functionalities and directory management.

- Replace deprecated CMake API.

***NO_CI***
Copy link

coderabbitai bot commented Jul 23, 2024

Walkthrough

The recent updates focus on enhancing build performance across various target platforms by integrating caching mechanisms for ccache in Azure Pipelines. Key improvements include the addition of caching tasks in configuration files, modifications to CMake compiler settings, and the introduction of a dedicated template for downloading ccache. These changes aim to streamline the build process, reduce recompilation times, and maintain a clean project structure.

Changes

File Path Change Summary
.gitignore Added rule to ignore ccache cache files, improving repository cleanliness.
azure-pipelines-templates/...build-azurertos-targets.yml
...build-chibios-stm32-targets.yml
...build-espressif-esp32-targets.yml
...build-freertos-nxp-targets.yml
...build-ti-simplelink-targets.yml
Introduced caching tasks for ccache files; modified cmakeArgs to use ccache as compiler launcher.
azure-pipelines-templates/download-ccache.yml New file for caching and managing ccache installation within the pipeline.
azure-pipelines.yml Added CCACHE_DIR variable; included step to download ccache template for various jobs.

Sequence Diagram(s)

sequenceDiagram
    participant CI as CI/CD Pipeline
    participant Cache as Cache System
    participant Build as Build Environment

    CI->>Cache: Cache ccache files
    Cache->>CI: Cache available
    CI->>Build: Start build with ccache
    Build->>Cache: Restore ccache files
    Cache-->>Build: Provide cached files
    Build->>CI: Complete build
    CI->>Cache: Save ccache files
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fc168ed and 2430ce5.

Files selected for processing (8)
  • .gitignore (1 hunks)
  • azure-pipelines-templates/build-azurertos-targets.yml (1 hunks)
  • azure-pipelines-templates/build-chibios-stm32-targets.yml (1 hunks)
  • azure-pipelines-templates/build-espressif-esp32-targets.yml (2 hunks)
  • azure-pipelines-templates/build-freertos-nxp-targets.yml (2 hunks)
  • azure-pipelines-templates/build-ti-simplelink-targets.yml (2 hunks)
  • azure-pipelines-templates/download-ccache.yml (1 hunks)
  • azure-pipelines.yml (7 hunks)
Files skipped from review due to trivial changes (1)
  • .gitignore
Additional context used
yamllint
azure-pipelines-templates/download-ccache.yml

[error] 1-1: wrong new line character: expected \n

(new-lines)

Additional comments not posted (31)
azure-pipelines-templates/download-ccache.yml (4)

5-10: LGTM!

The caching step for ccache is correctly configured with the appropriate key and path.


12-22: LGTM!

The PowerShell step to download ccache is correctly configured with the appropriate URL and download logic.


24-29: LGTM!

The extraction step for ccache is correctly configured with the appropriate archive file patterns and destination folder.


31-33: LGTM!

The script step to add ccache to the PATH is correctly configured with the appropriate script and condition.

azure-pipelines-templates/build-ti-simplelink-targets.yml (3)

14-19: LGTM!

The caching step for ccache files is correctly configured with the appropriate key and path.


23-23: LGTM!

The CMake step for setting up the build with ccache as the compiler launcher is correctly configured with the appropriate CMake arguments.


33-37: LGTM!

The step for saving ccache files is correctly configured with the appropriate key and path.

azure-pipelines-templates/build-freertos-nxp-targets.yml (3)

14-19: LGTM!

The caching step for ccache files is correctly configured with the appropriate key and path.


23-23: LGTM!

The CMake step for setting up the build with ccache as the compiler launcher is correctly configured with the appropriate CMake arguments.


33-37: LGTM!

The step for saving ccache files is correctly configured with the appropriate key and path.

azure-pipelines-templates/build-chibios-stm32-targets.yml (3)

14-20: LGTM! The caching task for ccache files is correctly configured.

The Cache@2 task is well-integrated to cache ccache files before the build process, which should help in reducing build times.


25-46: LGTM! The cmakeArgs modifications are consistent and correctly integrated.

The inclusion of -DCMAKE_C_COMPILER_LAUNCHER=ccache and -DCMAKE_CXX_COMPILER_LAUNCHER=ccache in the cmakeArgs parameters across multiple CMake tasks is consistent and should enhance build efficiency.


55-59: LGTM! The caching task for saving ccache files is correctly configured.

The Cache@2 task is well-integrated to save ccache files after the build process, which should help in reducing build times for subsequent builds.

azure-pipelines-templates/build-azurertos-targets.yml (3)

14-20: LGTM! The caching task for ccache files is correctly configured.

The Cache@2 task is well-integrated to cache ccache files before the build process, which should help in reducing build times.


25-46: LGTM! The cmakeArgs modifications are consistent and correctly integrated.

The inclusion of -DCMAKE_C_COMPILER_LAUNCHER=ccache and -DCMAKE_CXX_COMPILER_LAUNCHER=ccache in the cmakeArgs parameters across multiple CMake tasks is consistent and should enhance build efficiency.


55-59: LGTM! The caching task for saving ccache files is correctly configured.

The Cache@2 task is well-integrated to save ccache files after the build process, which should help in reducing build times for subsequent builds.

azure-pipelines-templates/build-espressif-esp32-targets.yml (5)

17-23: LGTM! The caching task for IDF components is correctly configured.

The Cache@2 task is well-integrated to cache IDF components before the build process, which should help in reducing build times.


24-30: LGTM! The caching task for ccache files is correctly configured.

The Cache@2 task is well-integrated to cache ccache files before the build process, which should help in reducing build times.


35-35: LGTM! The cmakeArgs modification is correctly integrated.

The inclusion of -DCMAKE_C_COMPILER_LAUNCHER=ccache and -DCMAKE_CXX_COMPILER_LAUNCHER=ccache in the cmakeArgs parameter should enhance build efficiency.


115-120: LGTM! The caching task for saving IDF components is correctly configured.

The Cache@2 task is well-integrated to save IDF components after the build process, which should help in reducing build times for subsequent builds.


121-125: LGTM! The caching task for saving ccache files is correctly configured.

The Cache@2 task is well-integrated to save ccache files after the build process, which should help in reducing build times for subsequent builds.

azure-pipelines.yml (10)

417-417: LGTM! Setting CCACHE_DIR for STM32 targets.

The CCACHE_DIR variable is correctly set to improve build performance by caching compilation results.


426-426: LGTM! Adding ccache download template for STM32 targets.

The template to download ccache is correctly added, which will help in caching compilation results and improving build performance.


568-568: LGTM! Enabling ccache for ESP32 targets.

The IDF_CCACHE_ENABLE variable is correctly set to "1", enabling ccache for ESP32 targets to improve build performance.


569-569: LGTM! Setting CCACHE_DIR for ESP32 targets.

The CCACHE_DIR variable is correctly set to improve build performance by caching compilation results.


652-652: LGTM! Setting CCACHE_DIR for FreeRTOS targets.

The CCACHE_DIR variable is correctly set to improve build performance by caching compilation results.


660-660: LGTM! Adding ccache download template for FreeRTOS targets.

The template to download ccache is correctly added, which will help in caching compilation results and improving build performance.


732-732: LGTM! Setting CCACHE_DIR for TI SimpleLink targets.

The CCACHE_DIR variable is correctly set to improve build performance by caching compilation results.


739-739: LGTM! Adding ccache download template for TI SimpleLink targets.

The template to download ccache is correctly added, which will help in caching compilation results and improving build performance.


805-805: LGTM! Setting CCACHE_DIR for Azure RTOS targets.

The CCACHE_DIR variable is correctly set to improve build performance by caching compilation results.


814-814: LGTM! Adding ccache download template for Azure RTOS targets.

The template to download ccache is correctly added, which will help in caching compilation results and improving build performance.

- Add ccache to all platforms.
- Adjust AZDO pipeline yamls.
- Add PS1 to install install ccache.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2430ce5 and a17508e.

Files selected for processing (9)
  • .gitignore (1 hunks)
  • azure-pipelines-nightly.yml (5 hunks)
  • azure-pipelines-templates/build-azurertos-targets.yml (1 hunks)
  • azure-pipelines-templates/build-chibios-stm32-targets.yml (1 hunks)
  • azure-pipelines-templates/build-espressif-esp32-targets.yml (2 hunks)
  • azure-pipelines-templates/build-freertos-nxp-targets.yml (2 hunks)
  • azure-pipelines-templates/build-ti-simplelink-targets.yml (2 hunks)
  • azure-pipelines-templates/download-ccache.yml (1 hunks)
  • azure-pipelines.yml (7 hunks)
Files skipped from review as they are similar to previous changes (7)
  • .gitignore
  • azure-pipelines-templates/build-azurertos-targets.yml
  • azure-pipelines-templates/build-chibios-stm32-targets.yml
  • azure-pipelines-templates/build-espressif-esp32-targets.yml
  • azure-pipelines-templates/build-freertos-nxp-targets.yml
  • azure-pipelines-templates/build-ti-simplelink-targets.yml
  • azure-pipelines.yml
Additional context used
yamllint
azure-pipelines-templates/download-ccache.yml

[error] 1-1: wrong new line character: expected \n

(new-lines)

Additional comments not posted (10)
azure-pipelines-templates/download-ccache.yml (4)

4-10: LGTM! Caching step is correctly configured.

The Cache@2 task is properly set up to cache ccache using the specified key and path.


12-22: LGTM! Download step is correctly configured.

The PowerShell@2 task is properly set up to download ccache if it is not restored from the cache. The script handles errors with errorActionPreference: "stop" and failOnStderr: true.


24-29: LGTM! Extraction step is correctly configured.

The ExtractFiles@1 task is properly set up to extract the downloaded ccache zip file to the specified destination folder.


31-33: LGTM! PATH addition step is correctly configured.

The script correctly adds ccache to the PATH if the previous steps succeed.

azure-pipelines-nightly.yml (6)

299-299: LGTM! CCACHE_DIR variable is correctly defined.

The CCACHE_DIR variable is properly set up to specify the directory for ccache storage for STM32 targets.


308-308: LGTM! download-ccache.yml template is correctly integrated.

The download-ccache.yml template is properly integrated to download and install ccache for STM32 targets.


551-552: LGTM! IDF_CCACHE_ENABLE and CCACHE_DIR variables are correctly defined.

The IDF_CCACHE_ENABLE variable is properly set up to enable ccache and the CCACHE_DIR variable specifies the directory for ccache storage for ESP32 targets.


636-636: LGTM! download-ccache.yml template is correctly integrated.

The download-ccache.yml template is properly integrated to download and install ccache for ESP32 targets.


636-636: LGTM! download-ccache.yml template is correctly integrated.

The download-ccache.yml template is properly integrated to download and install ccache for TI SimpleLink targets.


690-690: LGTM! download-ccache.yml template is correctly integrated.

The download-ccache.yml template is properly integrated to download and install ccache for Azure RTOS targets.

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.

2 participants