Skip to content

Commit 7e881c0

Browse files
committed
ci: use composite action for devbuild on ubuntu & macos runner
Signed-off-by: Ray Huang <bjhuang@cs.nycu.edu.tw>
1 parent 8fc01b0 commit 7e881c0

File tree

4 files changed

+94
-395
lines changed

4 files changed

+94
-395
lines changed
Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
name: Setup modmesh CI dependencies on Linux
2-
description: Sets up the necessary dependencies for running CI tests on Github action Linux runners
1+
name: Set up modmesh CI dependencies on Linux
2+
description: Set up the necessary dependencies for running CI tests on Github action Linux runners
3+
4+
inputs:
5+
workflow:
6+
description: The name of the workflow that will use this action
7+
required: true
38

49
runs:
510
using: composite
@@ -47,19 +52,14 @@ runs:
4752
test -f /usr/share/doc/kitware-archive-keyring/copyright || \
4853
sudo rm /usr/share/keyrings/kitware-archive-keyring.gpg
4954
sudo apt-get -qy install kitware-archive-keyring
55+
sudo apt-get -qy install \
56+
sudo curl git build-essential make cmake libc6-dev gcc g++ \
57+
python3 python3-dev python3-venv
5058
# The path of apt-get cmake is `/usr/bin/cmake`,
5159
# but the path of built-in cmake of runner image is `/usr/local/bin/cmake`.
5260
# We remove the built-in cmake.
5361
sudo rm -rf /usr/local/bin/cmake
54-
# Install clang-tidy-21 from LLVM repository for full C++23 support
55-
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
56-
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list
57-
sudo apt-get -qqy update
58-
sudo apt-get -qy install \
59-
sudo curl git build-essential make cmake libc6-dev gcc g++ silversearcher-ag \
60-
clang-tidy-21 \
61-
python3 python3-dev python3-venv
62-
sudo ln -fs "$(which clang-tidy-21)" "/usr/local/bin/clang-tidy"
62+
6363
# Install qt6 only with ubuntu-24.04
6464
# This page explains why we need libgl1-mesa-dev
6565
# https://doc-snapshots.qt.io/qt6-dev/linux.html
@@ -75,7 +75,18 @@ runs:
7575
# libgl1-mesa-dev
7676
# fi
7777
78-
- name: install and configure gcc-14
78+
- name: Install clang-tidy for lint
79+
if: ${{ inputs.workflow == 'lint' }}
80+
shell: bash
81+
run: |
82+
# Install clang-tidy-21 from LLVM repository for full C++23 support
83+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
84+
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list
85+
sudo apt-get -qqy update
86+
sudo apt-get -qy install clang-tidy-21 silversearcher-ag
87+
sudo ln -fs "$(which clang-tidy-21)" "/usr/local/bin/clang-tidy"
88+
89+
- name: Install and configure gcc-14
7990
shell: bash
8091
run: |
8192
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
@@ -97,11 +108,18 @@ runs:
97108
setup-python: 'false'
98109
cache: false
99110

100-
- name: dependency by pip
111+
- name: dependency by pip (common)
101112
shell: bash
102113
run: |
103114
sudo pip3 install setuptools
104-
sudo pip3 install numpy matplotlib pytest flake8 jsonschema pyside6==$(qmake6 -query QT_VERSION)
115+
sudo pip3 install numpy pytest flake8
116+
117+
- name: dependency by pip (lint & build)
118+
if: "${{ inputs.workflow == 'lint' || inputs.workflow == 'build' }}"
119+
shell: bash
120+
run: |
121+
sudo pip3 install matplotlib jsonschema
122+
sudo pip3 install pyside6==$(qmake6 -query QT_VERSION)
105123
106124
- name: dependency (manual)
107125
shell: bash
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
name: Setup modmesh CI dependencies on MacOS
2-
description: Sets up the necessary dependencies for running CI tests on Github action MacOS runners
1+
name: Set up modmesh CI dependencies on MacOS
2+
description: Set up the necessary dependencies for running CI tests on Github action MacOS runners
3+
4+
inputs:
5+
workflow:
6+
description: The name of the workflow that will use this action
7+
required: true
38

49
runs:
510
using: composite
@@ -53,6 +58,12 @@ runs:
5358
shell: bash
5459
run: sudo NO_INSTALL_PREFIX=1 ${GITHUB_WORKSPACE}/contrib/dependency/install.sh pybind11
5560

61+
- name: dependency (manual) for build
62+
if: ${{ inputs.workflow == 'build' }}
63+
shell: bash
64+
run: |
65+
thirdparty/metal-cpp.sh
66+
5667
- name: show dependency
5768
shell: bash
5869
# Copy the commands from contrib/dependency/showdep.sh

0 commit comments

Comments
 (0)