summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Niklas Hasse <jhasse@bixense.com>2020-04-24 12:59:51 +0200
committerJan Niklas Hasse <jhasse@bixense.com>2020-05-18 17:18:10 +0200
commit281618a81b8b00cff7c7b71e9fc7c5077b70de95 (patch)
tree0fd4fe965a08c6ae7b17798c5d60a61e5b6bfe9a
parentcf021f32e62370b7f9c8249a6c600cbe48e849c7 (diff)
downloadninja-281618a81b8b00cff7c7b71e9fc7c5077b70de95.tar.gz
GitHub Actions: Also run on Ubuntu 18.04
Builds with both GCC and Clang and runs clang-tidy, too.
-rw-r--r--.clang-tidy9
-rw-r--r--.github/workflows/linux.yml33
2 files changed, 42 insertions, 0 deletions
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