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 v0.12