Skip to content

Commit

Permalink
🚨 add new CI and fix warnings (#2561)
Browse files Browse the repository at this point in the history
* ⚗️ move CI targets to CMake
* ♻️ add target for cpplint
* ♻️ add target for self-contained binaries
* ♻️ add targets for iwyu and infer
* 🔊 add version output
* ♻️ add target for oclint
* 🚨 fix warnings
* ♻️ rename targets
* ♻️ use iwyu properly
* 🚨 fix warnings
* ♻️ use iwyu properly
* ♻️ add target for benchmarks
* ♻️ add target for CMake flags
* 👷 use GitHub Actions
* ⚗️ try to install Clang 11
* ⚗️ try to install GCC 11
* ⚗️ try to install Clang 11
* ⚗️ try to install GCC 11
* ⚗️ add clang analyze target
* 🔥 remove Google Benchmark
* ⬆️ Google Benchmark 1.5.2
* 🔥 use fetchcontent
* 🐧 add target to download a Linux version of CMake
* 🔨 fix dependency
* 🚨 fix includes
* 🚨 fix comment
* 🔧 adjust flags for GCC 11.0.0 20210110 (experimental)
* 🐳 user Docker image to run CI
* 🔧 add target for Valgrind
* 👷 add target for Valgrind tests
* ⚗️ add Dart
* ⏪ remove Dart
* ⚗️ do not call ctest in test subdirectory
* ⚗️ download test data explicitly
* ⚗️ only execute Valgrind tests
* ⚗️ fix labels
* 🔥 remove unneeded jobs
* 🔨 cleanup
* 🐛 fix OCLint call
* ✅ add targets for offline and git-independent tests
* ✅ add targets for C++ language versions and reproducible tests
* 🔨 clean up
* 👷 add CI steps for cppcheck and cpplint
* 🚨 fix warnings from Clang-Tidy
* 👷 add CI steps for Clang-Tidy
* 🚨 fix warnings
* 🔧 select proper binary
* 🚨 fix warnings
* 🚨 suppress some unhelpful warnings
* 🚨 fix warnings
* 🎨 fix format
* 🚨 fix warnings
* 👷 add CI steps for Sanitizers
* 🚨 fix warnings
* ⚡ add optimization to sanitizer build
* 🚨 fix warnings
* 🚨 add missing header
* 🚨 fix warnings
* 👷 add CI step for coverage
* 👷 add CI steps for disabled exceptions and implicit conversions
* 🚨 fix warnings
* 👷 add CI steps for checking indentation
* 🐛 fix variable use
* 💚 fix build
* ➖ remove CircleCI
* 👷 add CI step for diagnostics
* 🚨 fix warning
* 🔥 clean Travis
  • Loading branch information
nlohmann committed Mar 24, 2021
1 parent 6b74772 commit 6f55193
Show file tree
Hide file tree
Showing 152 changed files with 2,492 additions and 12,146 deletions.
56 changes: 0 additions & 56 deletions .circleci/config.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .clang-tidy
@@ -1,23 +1,44 @@
Checks: '*,
-android-cloexec-fopen,
-cppcoreguidelines-avoid-goto,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-union-access,
-fuchsia-default-arguments-calls,
-fuchsia-default-arguments-declarations,
-fuchsia-overloaded-operator,
-google-explicit-constructor,
-google-readability-function-size,
-google-runtime-int,
-google-runtime-references,
-hicpp-avoid-goto,
-hicpp-explicit-conversions,
-hicpp-function-size,
-hicpp-no-array-decay,
-hicpp-no-assembler,
-hicpp-signed-bitwise,
-hicpp-uppercase-literal-suffix,
-llvm-header-guard,
-llvm-include-order,
-llvmlibc-*,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-modernize-use-trailing-return-type,
-readability-function-size,
-readability-magic-numbers,
-readability-redundant-access-specifiers,
-readability-uppercase-literal-suffix'

CheckOptions:
- key: hicpp-special-member-functions.AllowSoleDefaultDtor
value: 1

WarningsAsErrors: '*'

#HeaderFilterRegex: '.*nlohmann.*'
HeaderFilterRegex: '.*hpp$'
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: macos-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
- name: build
Expand Down
205 changes: 160 additions & 45 deletions .github/workflows/ubuntu.yml
Expand Up @@ -3,62 +3,177 @@ name: Ubuntu
on: [push, pull_request]

jobs:
gcc_build:
ci_test_clang_cxx20:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: install_gcc
- uses: actions/checkout@v2
- name: install_clang
run: |
sudo apt update
sudo apt install gcc-10 g++-10
sudo apt update
sudo apt install clang-10 ninja-build
shell: bash
- name: cmake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
env:
CC: gcc-10
CXX: g++-10
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --parallel 10
- name: test
run: cd build ; ctest -j 10 --output-on-failure
run: cmake --build build --target ci_test_clang_cxx20

clang_build:
ci_clang_analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install_ninja
run: |
sudo apt update
sudo apt install ninja-build
shell: bash
- name: install_clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 11
sudo apt-get install clang-tools-11
shell: bash
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --target ci_clang_analyze

ci_test_clang:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install_gcc
run: |
sudo apt update
sudo apt install clang-10
shell: bash
- name: cmake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
env:
CC: clang-10
CXX: clang++-10
- name: build
run: cmake --build build --parallel 10
- name: test
run: cd build ; ctest -j 10 --output-on-failure
- uses: actions/checkout@v2
- name: install_ninja
run: |
sudo apt update
sudo apt install ninja-build
shell: bash
- name: install_clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 11
sudo apt-get install clang-tools-11
shell: bash
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --target ci_test_clang

clang_build_cxx20:
ci_test_gcc:
runs-on: ubuntu-latest
container: nlohmann/json-ci:latest
steps:
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --target ci_test_gcc

ci_test_valgrind:
runs-on: ubuntu-latest
container: nlohmann/json-ci:latest
steps:
- uses: actions/checkout@v1
- name: install_gcc
run: |
sudo apt update
sudo apt install clang-10
shell: bash
- name: cmake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_STANDARD_REQUIRED=ON
env:
CC: clang-10
CXX: clang++-10
- name: build
run: cmake --build build --parallel 10
- name: test
run: cd build ; ctest -j 10 --output-on-failure
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --target ci_test_valgrind

ci_cppcheck:
runs-on: ubuntu-latest
container: nlohmann/json-ci:latest
steps:
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --target ci_cppcheck

ci_cpplint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --target ci_cpplint

ci_clang_tidy:
runs-on: ubuntu-latest
container: nlohmann/json-ci:latest
steps:
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --target ci_clang_tidy

ci_test_amalgamation:
runs-on: ubuntu-latest
container: nlohmann/json-ci:latest
steps:
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --target ci_test_amalgamation

ci_test_diagnostics:
runs-on: ubuntu-latest
container: nlohmann/json-ci:latest
steps:
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --target ci_test_diagnostics

ci_test_noexceptions:
runs-on: ubuntu-latest
container: nlohmann/json-ci:latest
steps:
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --target ci_test_noexceptions

ci_test_noimplicitconversions:
runs-on: ubuntu-latest
container: nlohmann/json-ci:latest
steps:
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --target ci_test_noimplicitconversions

ci_test_clang_sanitizer:
runs-on: ubuntu-latest
container: nlohmann/json-ci:latest
steps:
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --target ci_test_clang_sanitizer

ci_test_coverage:
runs-on: ubuntu-latest
container: nlohmann/json-ci:latest
steps:
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --target ci_test_coverage
- name: archive coverage report
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: /__w/json/json/build/html
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: /__w/json/json/build/json.info.filtered.noexcept
8 changes: 4 additions & 4 deletions .github/workflows/windows.yml
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -G "Visual Studio 16 2019" -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
- name: build
Expand All @@ -19,7 +19,7 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: install Clang
run: curl -fsSL -o LLVM10.exe https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe ; 7z x LLVM10.exe -y -o"C:/Program Files/LLVM"
- name: cmake
Expand All @@ -33,7 +33,7 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -G "Visual Studio 16 2019" -A x64 -T ClangCL -DJSON_BuildTests=On
- name: build
Expand All @@ -45,7 +45,7 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -G "Visual Studio 16 2019" -A Win32 -T ClangCL -DJSON_BuildTests=On
- name: build
Expand Down

0 comments on commit 6f55193

Please sign in to comment.