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

feat: introduce a new workflow to verify build script on multi platforms #196

Merged
merged 10 commits into from
Dec 20, 2024

Conversation

spencercjh
Copy link
Contributor

@spencercjh spencercjh commented Dec 19, 2024

CLOSE #176

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 19, 2024
Copy link

vercel bot commented Dec 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kyanos ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 2:04pm

@spencercjh spencercjh changed the title feat: introduce test and format steps to test.yml feat: introduce test and format steps to test.yml Dec 19, 2024
@hengyoush
Copy link
Owner

hengyoush commented Dec 19, 2024

Thanks for your contribution!

Here are some suggestions I have:

  1. I think we can add a workflow specifically for testing whether the build can be done on multiple platforms, while the current test.yml is mainly used for e2e tests and it build kyanos on Ubuntu 22.04 only .
  2. Initially, we can add tests for Ubuntu only. The test environment should include multiple versions of Ubuntu and both ARM/AMD architectures (use matrix). The main focus is to test whether init_env.sh can complete the build. Other platforms like CentOS, Fedora, etc., can be added later.
  3. I think we can skip adding go test for now because many tests are currently broken and need to be fixed, which will take some time.

What do you think?

@spencercjh
Copy link
Contributor Author

spencercjh commented Dec 19, 2024

Thanks for your contribution!

Here are some suggestions I have:

  1. I think we can add a workflow specifically for testing whether the build can be done on multiple platforms, while the current test.yml is mainly used for e2e tests and it build kyanos on Ubuntu 22.04 only .
  2. Initially, we can add tests for Ubuntu only. The test environment should include multiple versions of Ubuntu and both ARM/AMD architectures. The main focus is to test whether init_env.sh can complete the build. Other platforms like CentOS, Fedora, etc., can be added later.
  3. I think we can skip adding go test for now because many tests are currently broken and need to be fixed, which will take some time.

What do you think?

You're right.

Also I have to take some time to get a working Ubuntu workspace.😅

@spencercjh spencercjh closed this Dec 19, 2024
@spencercjh spencercjh reopened this Dec 19, 2024
@spencercjh spencercjh changed the title feat: introduce test and format steps to test.yml wip: feat: introduce test and format steps to test.yml Dec 19, 2024
@spencercjh spencercjh marked this pull request as draft December 20, 2024 03:19
@spencercjh spencercjh changed the title wip: feat: introduce test and format steps to test.yml feat: introduce test and format steps to test.yml Dec 20, 2024
@spencercjh spencercjh changed the title feat: introduce test and format steps to test.yml feat: introduce a new Check workflow Dec 20, 2024
@spencercjh
Copy link
Contributor Author

spencercjh commented Dec 20, 2024

Thanks for your contribution!

Here are some suggestions I have:

  1. I think we can add a workflow specifically for testing whether the build can be done on multiple platforms, while the current test.yml is mainly used for e2e tests and it build kyanos on Ubuntu 22.04 only .
  2. Initially, we can add tests for Ubuntu only. The test environment should include multiple versions of Ubuntu and both ARM/AMD architectures (use matrix). The main focus is to test whether init_env.sh can complete the build. Other platforms like CentOS, Fedora, etc., can be added later.
  3. I think we can skip adding go test for now because many tests are currently broken and need to be fixed, which will take some time.

What do you think?

I attempted to implement your suggestions, but I found that the free version on GitHub (as opposed to the Team and Enterprise versions) does not support ARM64 runners: https://docs.github.com/en/actions/using-github-hosted-runners/using-larger-runners/about-larger-runners

@spencercjh spencercjh marked this pull request as ready for review December 20, 2024 12:28
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Dec 20, 2024
@spencercjh spencercjh changed the title feat: introduce a new Check workflow feat: introduce a new workflow to verify build script on multi platforms Dec 20, 2024
@spencercjh spencercjh marked this pull request as draft December 20, 2024 12:33
@spencercjh
Copy link
Contributor Author

spencercjh commented Dec 20, 2024

kyanos/init_env.sh

Lines 11 to 30 in 4be0227

if [ ${release_num} == "20.10" ]; then
CLANG_NUM=-10
elif [ ${release_num} == "21.04" ]; then
CLANG_NUM=-11
elif [ ${release_num} == "21.10" ]; then
CLANG_NUM=-12
elif [ ${release_num} == "22.04" ]; then
CLANG_NUM=-12
elif [ ${release_num} == "22.10" ]; then
CLANG_NUM=-12
elif [ ${release_num} == "23.04" ];then
CLANG_NUM=-15
elif [ ${release_num} == "23.10" ];then
CLANG_NUM=-15
elif [ ${release_num} == "24.04" ];then
CLANG_NUM=-18
else
echo "used default CLANG Version"
CLANG_NUM=
fi

The Ubuntu version here doesn't exactly match the Ubuntu version in the runner provided by GitHub. You need to open another PR to change it. I'm sorry that I don't really understand the constraints of these distro and CLANG versions. That's why the test for ubuntu-20.04 fails now.

@spencercjh
Copy link
Contributor Author

To minimize the size of this PR, the workflow that governs the formatting and style of the code should be placed in a separate workflow yaml file.

@hengyoush
Copy link
Owner

Just add one check:

if [ ${release_num} == "20.04" ]; then
  CLANG_NUM=-10

I tested it on Ubuntu 20.04 and it works fine. @spencercjh

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 20, 2024
@hengyoush hengyoush merged commit a883010 into hengyoush:main Dec 20, 2024
15 checks passed
@spencercjh spencercjh deleted the feat/ci-gh-workflows branch December 23, 2024 03:19
hengyoush pushed a commit that referenced this pull request Jan 6, 2025
…rms (#196)

* feat: introduce new Check workflow

* fix: correct matrix

* fix: Make different matrices run independently of each other

* test: test init_env in the step

* style: resolve fmt issues

Signed-off-by: spencercjh <[email protected]>

* chore: simplify matrix

Signed-off-by: spencercjh <[email protected]>

* chore: rename the wf

Signed-off-by: spencercjh <[email protected]>

* chore: remove irrelevant codes to check format issues

Signed-off-by: spencercjh <[email protected]>

* fix: add missing build step

Signed-off-by: spencercjh <[email protected]>

* fix: add missing clang_num init biz for ubuntu 20.04

Signed-off-by: spencercjh <[email protected]>

---------

Signed-off-by: spencercjh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add build test workflow
2 participants