Skip to content

ci: composite actions for setting up dependencies for macOS and Linux runners#691

Open
ExplorerRay wants to merge 2 commits intosolvcon:masterfrom
ExplorerRay:ci-composite
Open

ci: composite actions for setting up dependencies for macOS and Linux runners#691
ExplorerRay wants to merge 2 commits intosolvcon:masterfrom
ExplorerRay:ci-composite

Conversation

@ExplorerRay
Copy link
Collaborator

I just add setup_macOS and setup_Linux composite actions for dependency and use them in devbuild and lint workflows to solve part of #677.

These two composite actions have one input called workflow to decide whether some packages should be installed or not.
For example, clang-tidy is only needed when doing lint.

Signed-off-by: Ray Huang <bjhuang@cs.nycu.edu.tw>
echo "pyside6 path: ${PYSIDE6_PATH}"
rm -rf ${PYSIDE6_PATH}/Qt/lib/*.framework
# maunally add homebrew's Qt rpath to PySide6
install_name_tool -add_rpath $(qtpaths --install-prefix)/lib ${PYSIDE6_PATH}/QtWidgets.abi3.so
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I want to mention that I remove some lines like these (L498 - 500), I originally want to fix it if the CI fails.
However, it works without any error, so I think it's okay to remove these things.

Copy link
Member

Choose a reason for hiding this comment

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

Please keep the lines. They are hard-learnt know-how. It will be hard to recover the knowledge 5 years after we drop them from the file.

But you can keep them commented out in the file if not wanting to have them active. If you can find the PR originally added the lines, it will be great to add it to the comment.

Copy link
Member

@yungyuc yungyuc left a comment

Choose a reason for hiding this comment

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

  • Use all-lower-case for directory names: setup_linux and setup_macos. It is ambiguous to mix lower and upper cases.
  • Keep the lines for mac install_name_tool. They are hard-learnt know-how.

@@ -0,0 +1,151 @@
name: Setup modmesh CI dependencies on Linux
Copy link
Member

Choose a reason for hiding this comment

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

"Setup" is not a verb (at least was not one). Use "Set up" like what you wrote in the next line.

@@ -0,0 +1,151 @@
name: Setup modmesh CI dependencies on Linux
description: Sets up the necessary dependencies for running CI tests on Github action Linux runners
Copy link
Member

Choose a reason for hiding this comment

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

Use correct tense. It's "Set up", not "Sets up".

echo "pyside6 path: ${PYSIDE6_PATH}"
rm -rf ${PYSIDE6_PATH}/Qt/lib/*.framework
# maunally add homebrew's Qt rpath to PySide6
install_name_tool -add_rpath $(qtpaths --install-prefix)/lib ${PYSIDE6_PATH}/QtWidgets.abi3.so
Copy link
Member

Choose a reason for hiding this comment

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

Please keep the lines. They are hard-learnt know-how. It will be hard to recover the knowledge 5 years after we drop them from the file.

But you can keep them commented out in the file if not wanting to have them active. If you can find the PR originally added the lines, it will be great to add it to the comment.

@yungyuc yungyuc added the build Build system and automation label Mar 12, 2026
@yungyuc
Copy link
Member

yungyuc commented Mar 12, 2026

@terrychan999 @chestercheng please help review the changes. It looks good to me but it's too long for me to be sure that everything is right. More eye balls help.

@ExplorerRay
Copy link
Collaborator Author

  • Use all-lower-case for directory names: setup_linux and setup_macos. It is ambiguous to mix lower and upper cases.

About the directory name, I use these cases because Linux and macOS are defined in runner.os (ref).

With this, we can further improve the following code into another one refers to this discussion.

- name: setup dependencies for Linux
    if: runner.os == 'Linux'
    uses: ./.github/actions/setup_Linux
    with:
      workflow: 'lint'

  - name: setup dependencies for macOS
    if: runner.os == 'macOS'
    uses: ./.github/actions/setup_macOS
    with:
      workflow: 'lint'
- name: setup dependencies
    uses: jenseng/dynamic-uses@v1
    with:
      uses: ./.github/actions/setup_${{ runner.os }}
      with: 
        workflow: 'lint'

@yungyuc
Copy link
Member

yungyuc commented Mar 12, 2026

  • Use all-lower-case for directory names: setup_linux and setup_macos. It is ambiguous to mix lower and upper cases.

About the directory name, I use these cases because Linux and macOS are defined in runner.os (ref).

With this, we can further improve the following code into another one refers to this discussion.

- name: setup dependencies for Linux
    if: runner.os == 'Linux'
    uses: ./.github/actions/setup_Linux
    with:
      workflow: 'lint'

  - name: setup dependencies for macOS
    if: runner.os == 'macOS'
    uses: ./.github/actions/setup_macOS
    with:
      workflow: 'lint'
- name: setup dependencies
    uses: jenseng/dynamic-uses@v1
    with:
      uses: ./.github/actions/setup_${{ runner.os }}
      with: 
        workflow: 'lint'

Directory names of mixed cases are not an improvement. The directory names do not need to be identical to variable contents.

Let's use all-lower-case directory.

@ExplorerRay ExplorerRay force-pushed the ci-composite branch 2 times, most recently from 7e881c0 to 6c48f44 Compare March 12, 2026 14:18
@ExplorerRay
Copy link
Collaborator Author

  • Use all-lower-case for directory names: setup_linux and setup_macos. It is ambiguous to mix lower and upper cases.
  • Keep the lines for mac install_name_tool. They are hard-learnt know-how.

I just fixed them. Please review again. Thanks.

Copy link
Member

@yungyuc yungyuc left a comment

Choose a reason for hiding this comment

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

LGTM. @terrychan999 @chestercheng please help review.

Copy link
Collaborator

@chestercheng chestercheng left a comment

Choose a reason for hiding this comment

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

@ExplorerRay thanks for the refactor.
Moving the environment setup into composite actions helps reduce duplication and makes the workflows easier to maintain.

runs:
using: composite
steps:
- uses: actions/checkout@v6
Copy link
Collaborator

Choose a reason for hiding this comment

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

The workflow already checkout the repo before. This step may be redundant.

runs:
using: composite
steps:
- uses: actions/checkout@v6
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just fixed them and CI worked well.

Signed-off-by: Ray Huang <bjhuang@cs.nycu.edu.tw>
@yungyuc
Copy link
Member

yungyuc commented Mar 13, 2026

@chestercheng make a global comment again if you are good with the change.

Copy link
Collaborator

@chestercheng chestercheng left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build system and automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants