OSDN Git Service

[update] ビルドチェックの更新
authorHabu <habu1010+github@gmail.com>
Wed, 17 Mar 2021 11:13:51 +0000 (20:13 +0900)
committerHabu <habu1010+github@gmail.com>
Wed, 17 Mar 2021 11:57:20 +0000 (20:57 +0900)
Mac App版のビルドができるかをチェックするために、
clangでのコンパイルテストを追加する。
また、一通りワーニング対策を実施したので、警告抑制フラグを
除去する。但し、EUC-JPのソースコードをコンパイルしようと
するとclangは警告を出すので、-Wno-invalid-source-encodingを
付加しておく。
ビルドエラーになった時にログが長くてエラーの箇所を探しづらい
ので、makeコマンドの標準出力は/dev/nullに捨てて標準エラー
出力のみを表示するようにする。

.github/workflows/buildtest-on-linux.yml

index 716d3f8..d8b671d 100644 (file)
@@ -12,7 +12,7 @@ jobs:
     name: Build test on Ubuntu-20.04
     runs-on: ubuntu-20.04
     env:
-      CFLAGS: "-pipe -O3 -Werror -Wall -Wextra -Wno-switch -Wno-sign-compare -Wno-unused-parameter -Wno-unused-function"
+      CXXFLAGS: "-pipe -O3 -Werror -Wall -Wextra"
     steps:
       - uses: actions/checkout@v2
 
@@ -24,6 +24,7 @@ jobs:
             libncursesw5-dev \
             libcurl4-openssl-dev \
             nkf \
+            clang-11 \
 
       - name: Generate configure
         run: ./bootstrap
@@ -32,13 +33,25 @@ jobs:
         run: ./configure
 
       - name: Build Japanese version
-        run: make -j$(nproc)
+        run: make -j$(nproc) 1> /dev/null
 
       - name: Clean source tree
         run: make clean
 
-      - name: Configure for English versoin
+      - name: Configure for English version
         run: ./configure --disable-japanese
 
       - name: Build English version
-        run: make -j$(nproc)
+        run: make -j$(nproc) 1> /dev/null
+
+      - name: Clean source tree
+        run: make clean
+
+      - name: Configure for compiling with clang
+        run: ./configure
+        env:
+          CXX: clang++-11
+          CXXFLAGS: "-pipe -O3 -Werror -Wall -Wextra -Wno-unused-const-variable -Wno-invalid-source-encoding"
+
+      - name: Build with clang
+        run: make -j$(nproc) 1> /dev/null