This repository has been archived by the owner on Jul 4, 2024. It is now read-only.
Add -cppcoreguidelines-avoid-do-while (#61) #165
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Main | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '**.md' | |
- '.gitignore' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '.gitignore' | |
jobs: | |
format: | |
name: Format | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v3 | |
- name: Check formatting | |
uses: DoozyX/clang-format-lint-action@v0.15 | |
with: | |
clangFormatVersion: 12 | |
doxygen: | |
name: Doxygen | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v3 | |
- name: Install apt packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install doxygen qtmultimedia5-dev | |
- name: Generate documentation | |
run: | | |
cmake -B build -D DOXYGEN_WARN_AS_ERROR=YES | |
cmake --build build --target QOnlineTranslatorDocumentation | |
build: | |
name: Build | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-2019] | |
include: | |
- os: ubuntu-20.04 | |
extra-cmake-arguments: >- | |
-D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror" | |
- os: windows-2019 | |
extra-cmake-arguments: >- | |
-D CMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake | |
-D VCPKG_TARGET_TRIPLET=x64-windows | |
-D VCPKG_INSTALL_OPTIONS=--clean-after-build | |
-D CMAKE_CXX_FLAGS="/experimental:external /external:anglebrackets /external:W0 /W4 /WX" | |
-D CMAKE_CXX_CLANG_TIDY='clang-tidy;--warnings-as-errors=*' | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v3 | |
- name: Install apt packages | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install qtmultimedia5-dev ninja-build | |
- name: Install vcpkg packages | |
uses: lukka/run-vcpkg@v10.7 | |
if: runner.os == 'Windows' | |
with: | |
vcpkgGitCommitId: d4acc3c3f2db0b9fa7fc47b4751ec5778331f996 | |
- name: Setup MSVC | |
if: runner.os == 'Windows' | |
uses: ilammy/msvc-dev-cmd@v1 | |
# See https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4766#note_1091927 | |
- name: Downgrade CMake | |
if: runner.os == 'Windows' | |
uses: lukka/get-cmake@v3.21.2 | |
- name: Build | |
run: | | |
cmake -B build -G Ninja ${{ matrix.extra-cmake-arguments }} | |
cmake --build build --parallel 2 |