Skip to content

Commit d632365

Browse files
authored
Merge pull request #81 from yungyuc/test/ci-new-os
Add Ubuntu 22.04 and macos 12 to pytest build job
2 parents 9acc09b + a5f2534 commit d632365

File tree

6 files changed

+30
-12
lines changed

6 files changed

+30
-12
lines changed

.clang-tidy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Checks: >
22
*,-clang-analyzer-alpha.*,-hicpp-*,
3+
-clang-diagnostic-ignored-optimization-argument,
34
-altera-*,
45
-abseil-*,
56
-bugprone-macro-parentheses,
@@ -18,12 +19,14 @@ Checks: >
1819
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
1920
-cppcoreguidelines-pro-bounds-constant-array-index,
2021
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
22+
-google-readability-casting,
2123
-google-readability-todo,
2224
-google-runtime-references,
2325
-hicpp-signed-bitwise,
2426
-llvm-header-guard,
2527
-llvm-include-order,
2628
-performance-noexcept-move-constructor,
29+
-readability-identifier-length,
2730
-readability-named-parameter,
2831
-readability-magic-numbers,
2932
-readability-redundant-access-specifiers,

.github/workflows/modmesh_install.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ jobs:
2828
fetch-depth: 1
2929

3030
- name: dependency (ubuntu)
31-
if: matrix.os != 'macos-11'
31+
if: ${{ startsWith(matrix.os, 'ubuntu') }}
3232
run: |
3333
sudo apt-get -qqy update
3434
sudo apt-get -qy install \
35-
sudo curl git build-essential make cmake libc6-dev gcc-10 g++-10 \
35+
sudo curl git build-essential make cmake libc6-dev gcc g++ \
3636
clang-tidy-10 \
3737
python3 python3-dev python3-venv
3838
sudo ln -s "$(which clang-tidy-10)" "$(dirname $(which clang-tidy-10))/clang-tidy"
3939
sudo pip3 install setuptools
4040
sudo pip3 install numpy pytest flake8
4141
4242
- name: dependency (macos)
43-
if: matrix.os == 'macos-11'
43+
if: ${{ startsWith(matrix.os, 'macos') }}
4444
run: |
4545
brew install python3 llvm
4646
ln -s "$(brew --prefix llvm)/bin/clang-format" "/usr/local/bin/clang-format"

.github/workflows/modmesh_pytest.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
os: [ubuntu-20.04, macos-11]
20+
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
2121
cmake_build_type: [Release, Debug]
2222

2323
fail-fast: false
@@ -29,19 +29,21 @@ jobs:
2929
fetch-depth: 1
3030

3131
- name: dependency (ubuntu)
32-
if: matrix.os != 'macos-11'
32+
if: ${{ startsWith(matrix.os, 'ubuntu') }}
3333
run: |
34+
VERSION_ID=$(bash -c 'source /etc/os-release ; echo $VERSION_ID')
35+
if [ "20.04" == "$VERSION_ID" ] ; then CLANG_TIDY_VERSION=10 ; else CLANG_TIDY_VERSION=14 ; fi
3436
sudo apt-get -qqy update
3537
sudo apt-get -qy install \
36-
sudo curl git build-essential make cmake libc6-dev gcc-10 g++-10 \
37-
clang-tidy-10 \
38+
sudo curl git build-essential make cmake libc6-dev gcc g++ \
39+
clang-tidy-${CLANG_TIDY_VERSION} \
3840
python3 python3-dev python3-venv
39-
sudo ln -s "$(which clang-tidy-10)" "$(dirname $(which clang-tidy-10))/clang-tidy"
41+
sudo ln -s "$(which clang-tidy-${CLANG_TIDY_VERSION})" "$(dirname $(which clang-tidy-${CLANG_TIDY_VERSION}))/clang-tidy"
4042
sudo pip3 install setuptools
4143
sudo pip3 install numpy pytest flake8
4244
4345
- name: dependency (macos)
44-
if: matrix.os == 'macos-11'
46+
if: ${{ startsWith(matrix.os, 'macos') }}
4547
run: |
4648
brew install python3 llvm
4749
ln -s "$(brew --prefix llvm)/bin/clang-format" "/usr/local/bin/clang-format"

.github/workflows/modmesh_viewer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ jobs:
2727
fetch-depth: 1
2828

2929
- name: dependency (ubuntu)
30-
if: matrix.os != 'macos-11'
30+
if: ${{ startsWith(matrix.os, 'ubuntu') }}
3131
run: |
3232
sudo apt-get -qqy update
3333
sudo apt-get -qy install \
34-
sudo curl git build-essential make cmake libc6-dev gcc-10 g++-10 \
34+
sudo curl git build-essential make cmake libc6-dev gcc g++ \
3535
python3 python3-dev python3-venv \
3636
qt6-3d-dev
3737
# TODO: not figure out why this is needed. Without this package, we do

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ include(GNUInstallDirs)
7575

7676
set(MODMESH_PY_DIR "${PROJECT_SOURCE_DIR}/modmesh")
7777

78-
set(COMMON_COMPILER_OPTIONS -Werror -Wall -Wextra)
78+
set(COMMON_COMPILER_OPTIONS -Wall -Wextra)
79+
if(USE_CLANG_TIDY AND LINT_AS_ERRORS)
80+
message(STATUS "Disable -Werror because clang-tidy (with lint as errors) is enabled")
81+
else()
82+
set(COMMON_COMPILER_OPTIONS ${COMMON_COMPILER_OPTIONS} -Werror)
83+
message(STATUS "Enable -Werror because clang-tidy (with lint as errors) is disabled")
84+
endif()
7985

8086
add_subdirectory(cpp/binary/pymod_modmesh)
8187
if(BUILD_QT)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Install system tools.
2+
apt-get -qy install sudo curl git
3+
# Install compiler and build tools.
4+
apt-get -qy install build-essential make cmake libc6-dev gcc g++ clang-tidy-14
5+
# Install Python.
6+
apt-get -qy install python3 python3-dev python3-env python3-setuptools python3.10-dev
7+
apt-get -qy install python3-numpy python3-pytest python3-flake8

0 commit comments

Comments
 (0)