From 281618a81b8b00cff7c7b71e9fc7c5077b70de95 Mon Sep 17 00:00:00 2001 From: Jan Niklas Hasse Date: Fri, 24 Apr 2020 12:59:51 +0200 Subject: GitHub Actions: Also run on Ubuntu 18.04 Builds with both GCC and Clang and runs clang-tidy, too. --- .clang-tidy | 9 +++++++++ .github/workflows/linux.yml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .clang-tidy diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..0b453ba --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,9 @@ +--- +Checks: ' + ,readability-avoid-const-params-in-decls, + ,readability-non-const-parameter, +' +WarningsAsErrors: ' + ,readability-avoid-const-params-in-decls, + ,readability-non-const-parameter, +' diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 71cd06e..20878ba 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -57,3 +57,36 @@ jobs: asset_path: ./artifact/ninja-linux.zip asset_name: ninja-linux.zip asset_content_type: application/zip + + test: + runs-on: [ubuntu-18.04] + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + sudo apt update + sudo apt install -y python3-pytest ninja-build clang-tidy-9 + pip install cmake==3.17.* + - name: Configure (GCC) + run: cmake -Bbuild-gcc -DCMAKE_BUILD_TYPE=Debug -GNinja + - name: Build (GCC) + run: ninja + working-directory: build-gcc + - name: Unit tests (GCC) + run: ./build-gcc/ninja_test + - name: Python tests (GCC) + run: pytest-3 --color=yes .. + working-directory: build-gcc + - name: Configure (Clang) + run: CC=clang-9 CXX=clang++-9 cmake -Bbuild-clang -DCMAKE_BUILD_TYPE=Debug -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=1 + - name: Build (Clang) + run: ninja + working-directory: build-clang + - name: Unit tests (Clang) + run: ./build-clang/ninja_test + - name: Python tests (Clang) + run: pytest-3 --color=yes .. + working-directory: build-clang + - name: clang-tidy + run: /usr/lib/llvm-9/share/clang/run-clang-tidy.py -header-filter=src + working-directory: build-clang -- cgit v1.2.1 From 2127dab42c92b39d87d99f5b24e880fb61c1278f Mon Sep 17 00:00:00 2001 From: Jan Niklas Hasse Date: Mon, 18 May 2020 18:30:42 +0200 Subject: GitHub Actions: Build and test both Debug and Release configs --- .github/workflows/linux.yml | 55 ++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 20878ba..5bfd3af 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -67,26 +67,45 @@ jobs: sudo apt update sudo apt install -y python3-pytest ninja-build clang-tidy-9 pip install cmake==3.17.* + - name: Configure (GCC) - run: cmake -Bbuild-gcc -DCMAKE_BUILD_TYPE=Debug -GNinja - - name: Build (GCC) - run: ninja - working-directory: build-gcc - - name: Unit tests (GCC) - run: ./build-gcc/ninja_test - - name: Python tests (GCC) - run: pytest-3 --color=yes .. - working-directory: build-gcc + run: cmake -Bbuild-gcc -DCMAKE_BUILD_TYPE=Debug -G'Ninja Multi-Config' + + - name: Build (GCC, Debug) + run: cmake --build build-gcc --config Debug + - name: Unit tests (GCC, Debug) + run: ./build-gcc/Debug/ninja_test + - name: Python tests (GCC, Debug) + run: pytest-3 --color=yes ../.. + working-directory: build-gcc/Debug + + - name: Build (GCC, Release) + run: cmake --build build-gcc --config Release + - name: Unit tests (GCC, Release) + run: ./build-gcc/Release/ninja_test + - name: Python tests (GCC, Release) + run: pytest-3 --color=yes ../.. + working-directory: build-gcc/Release + - name: Configure (Clang) - run: CC=clang-9 CXX=clang++-9 cmake -Bbuild-clang -DCMAKE_BUILD_TYPE=Debug -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=1 - - name: Build (Clang) - run: ninja - working-directory: build-clang - - name: Unit tests (Clang) - run: ./build-clang/ninja_test - - name: Python tests (Clang) - run: pytest-3 --color=yes .. - working-directory: build-clang + run: CC=clang-9 CXX=clang++-9 cmake -Bbuild-clang -DCMAKE_BUILD_TYPE=Debug -G'Ninja Multi-Config' -DCMAKE_EXPORT_COMPILE_COMMANDS=1 + + - name: Build (Clang, Debug) + run: cmake --build build-clang --config Debug + - name: Unit tests (Clang, Debug) + run: ./build-clang/Debug/ninja_test + - name: Python tests (Clang, Debug) + run: pytest-3 --color=yes ../.. + working-directory: build-clang/Debug + + - name: Build (Clang, Release) + run: cmake --build build-clang --config Release + - name: Unit tests (Clang, Release) + run: ./build-clang/Release/ninja_test + - name: Python tests (Clang, Release) + run: pytest-3 --color=yes ../.. + working-directory: build-clang/Release + - name: clang-tidy run: /usr/lib/llvm-9/share/clang/run-clang-tidy.py -header-filter=src working-directory: build-clang -- cgit v1.2.1 From aa6c4d88bddbb998a652f7ba8292ada660240f64 Mon Sep 17 00:00:00 2001 From: Jan Niklas Hasse Date: Thu, 4 Jun 2020 13:41:58 +0200 Subject: Add more clang-tidy checks --- .clang-tidy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.clang-tidy b/.clang-tidy index 0b453ba..2afce32 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -2,8 +2,12 @@ Checks: ' ,readability-avoid-const-params-in-decls, ,readability-non-const-parameter, + ,readability-container-size-empty, + ,readability-redundant-string-cstr, ' WarningsAsErrors: ' ,readability-avoid-const-params-in-decls, ,readability-non-const-parameter, + ,readability-container-size-empty, + ,readability-redundant-string-cstr, ' -- cgit v1.2.1 From 811b3d88764b7219cb78f5e1c4c711f09adb0835 Mon Sep 17 00:00:00 2001 From: Jan Niklas Hasse Date: Sat, 19 Sep 2020 10:58:05 +0200 Subject: GitHub Actions: Update to Ubuntu 20.04 --- .github/workflows/linux.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 5bfd3af..4f31a7a 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -59,13 +59,13 @@ jobs: asset_content_type: application/zip test: - runs-on: [ubuntu-18.04] + runs-on: [ubuntu-20.04] steps: - uses: actions/checkout@v2 - name: Install dependencies run: | sudo apt update - sudo apt install -y python3-pytest ninja-build clang-tidy-9 + sudo apt install -y python3-pytest ninja-build clang-tidy pip install cmake==3.17.* - name: Configure (GCC) @@ -88,7 +88,7 @@ jobs: working-directory: build-gcc/Release - name: Configure (Clang) - run: CC=clang-9 CXX=clang++-9 cmake -Bbuild-clang -DCMAKE_BUILD_TYPE=Debug -G'Ninja Multi-Config' -DCMAKE_EXPORT_COMPILE_COMMANDS=1 + run: CC=clang CXX=clang++ cmake -Bbuild-clang -DCMAKE_BUILD_TYPE=Debug -G'Ninja Multi-Config' -DCMAKE_EXPORT_COMPILE_COMMANDS=1 - name: Build (Clang, Debug) run: cmake --build build-clang --config Debug @@ -107,5 +107,5 @@ jobs: working-directory: build-clang/Release - name: clang-tidy - run: /usr/lib/llvm-9/share/clang/run-clang-tidy.py -header-filter=src + run: /usr/lib/llvm-10/share/clang/run-clang-tidy.py -header-filter=src working-directory: build-clang -- cgit v1.2.1 From 3b8b83802f409dccdc513c049afa93a6c52a6fea Mon Sep 17 00:00:00 2001 From: Jan Niklas Hasse Date: Sat, 19 Sep 2020 11:02:53 +0200 Subject: clang-tidy: Drop readability-container-size-empty due to tests --- .clang-tidy | 2 -- 1 file changed, 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 2afce32..8968011 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -2,12 +2,10 @@ Checks: ' ,readability-avoid-const-params-in-decls, ,readability-non-const-parameter, - ,readability-container-size-empty, ,readability-redundant-string-cstr, ' WarningsAsErrors: ' ,readability-avoid-const-params-in-decls, ,readability-non-const-parameter, - ,readability-container-size-empty, ,readability-redundant-string-cstr, ' -- cgit v1.2.1