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

ci: introduce build-test-tidy-pr #9709

Merged
merged 5 commits into from
Dec 24, 2024
Merged

ci: introduce build-test-tidy-pr #9709

merged 5 commits into from
Dec 24, 2024

Conversation

xmfcx
Copy link
Contributor

@xmfcx xmfcx commented Dec 22, 2024

Description

  • build-and-test-differential
  • clang-tidy-differential

These workflows have quite a history in autoware. They have been modified in many ways to make sure everything builds and is tested correctly. Sometimes they didn't fit into their machines, sometimes they were bound to labels to function.

Lately I had some complaints about the way they were structured:

Complaints

build-and-test-differential was extracted as a composite action

To overcome these issues, I've extracted it as a reusable workflow.

Checking cuda packages required an additional label

This meant, pr-labeler added the label with these rules:

"tag:require-cuda-build-and-test":
  - perception/**/*
  - sensing/**/*

This required adding the label and re-running the other steps. And it was also possible to add this label by hand and confuse the system.

Also prepare-build-and-test-differential job and its downstream logic was too complicated and hard to maintain.

clang-tidy-differential and clang-tidy-differential-cuda jobs were in build-and-test-differential job ☹️

And clang-tidy-differential was duplicated. Also its cache-key-element: was not set up correctly, it was missing cache and had to rebuild from scratch.

There was no clear success condition

We used to have 4 actual jobs:

  • build-and-test-differential
  • build-and-test-differential-cuda
  • clang-tidy-differential
  • clang-tidy-differential-cuda

But also if cuda jobs were skipped due to not having cuda related files changed, we also wanted them count as success.

Solution

  • Remove the tag:require-cuda-build-and-test and instead use tj-actions/changed-files@v45 in a simple way.
  • Introduce new workflow build-test-tidy-pr.yaml which contains these jobs:
    • require-label 🚪 Nothing below won't run without the label, ❌ Will fail if label is missing.
    • check-if-cuda-job-is-needed ↪️ Checks if PR modified perception/sensing folders
    • build-and-test-differential
    • build-and-test-differential-cuda
    • clang-tidy-differential
    • clang-tidy-differential-cuda

This top level workflow doesn't contain any implementation details. It is for orchestrating the other workflows by reusing those workflows.

The implementation is simple and the logic is easily readable.

  • build-and-test-differential and clang-tidy-differential are made into reusable workflows.

This way we can see all the steps easily and can reuse more steps in them.

I hope you like how it was simplified and cleaned.

Other changes:

  • 🌲 Switched to ubuntu-24.04 public runners. They provide 10GB more empty space, we can run all on them.
  • 🎁 Now uses newly created require-label to fail if label doesn't exists.
  • 🎅 Required label is renamed from tag:run-build-and-test-differential to run:build-and-test-differential

Related links

Links from main, before this PR:

A very old version of this workflow

How was this PR tested?

I've ran these tests from scratch sequentially after finishing up my changes, they are all tested on the latest version before review. 🪟

No relevant files changed to build-and-test

image

Normal package changed

🟢 Good change

image

🔴 Bad change

image

CUDA package changed

🟢 Good change

image

🔴 Bad change

image

@github-actions github-actions bot added the type:ci Continuous Integration (CI) processes and testing. (auto-assigned) label Dec 22, 2024
Copy link

github-actions bot commented Dec 22, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@xmfcx xmfcx force-pushed the ci/build-test-tidy-pr branch 6 times, most recently from 52a2670 to 91dfe88 Compare December 22, 2024 20:36
@github-actions github-actions bot added component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test labels Dec 22, 2024
Copy link

codecov bot commented Dec 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.67%. Comparing base (f2a4129) to head (3130919).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9709      +/-   ##
==========================================
- Coverage   29.67%   29.67%   -0.01%     
==========================================
  Files        1450     1450              
  Lines      108795   108781      -14     
  Branches    42683    42668      -15     
==========================================
- Hits        32281    32276       -5     
+ Misses      73071    73064       -7     
+ Partials     3443     3441       -2     
Flag Coverage Δ *Carryforward flag
differential-cuda 0.00% <ø> (?)
total 29.67% <ø> (+<0.01%) ⬆️ Carriedforward from f2a4129

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test and removed component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test labels Dec 22, 2024
@xmfcx xmfcx marked this pull request as ready for review December 22, 2024 23:53
@xmfcx xmfcx requested review from yhisaki and mitsudome-r December 22, 2024 23:53
@xmfcx xmfcx force-pushed the ci/build-test-tidy-pr branch from 5e6dc98 to 31b06f6 Compare December 23, 2024 15:58
Signed-off-by: M. Fatih Cırıt <[email protected]>
@xmfcx xmfcx force-pushed the ci/build-test-tidy-pr branch from 31b06f6 to 110ace5 Compare December 24, 2024 09:10
@xmfcx xmfcx added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 24, 2024
Signed-off-by: M. Fatih Cırıt <[email protected]>
@xmfcx xmfcx self-assigned this Dec 24, 2024
@xmfcx xmfcx removed the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 24, 2024
Signed-off-by: M. Fatih Cırıt <[email protected]>
@github-actions github-actions bot added component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test labels Dec 24, 2024
Signed-off-by: M. Fatih Cırıt <[email protected]>
@xmfcx
Copy link
Contributor Author

xmfcx commented Dec 24, 2024

Signed-off-by: M. Fatih Cırıt <[email protected]>
@github-actions github-actions bot removed component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test labels Dec 24, 2024
@xmfcx xmfcx merged commit 7102a48 into main Dec 24, 2024
26 checks passed
@xmfcx xmfcx deleted the ci/build-test-tidy-pr branch December 24, 2024 10:31
@xmfcx xmfcx added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 24, 2024
@xmfcx
Copy link
Contributor Author

xmfcx commented Dec 24, 2024

For the record, these are the new required checks with this PR:

image

kminoda pushed a commit to kminoda/autoware.universe that referenced this pull request Dec 25, 2024
kyoichi-sugahara pushed a commit to kyoichi-sugahara/autoware.universe that referenced this pull request Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) type:ci Continuous Integration (CI) processes and testing. (auto-assigned)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants