synchronization #7
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: Ubuntu / gcc11 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
BUILD_TYPE: Release | |
CLANG_TIDY_VERSION: 15 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
lfs: true | |
submodules: true | |
- name: Checkout LFS objects | |
run: git lfs checkout | |
- name: Install deps | |
run: | |
sudo apt-get update && | |
sudo apt-get install -y | |
gcc g++ | |
libx11-dev libxrandr-dev libgl1-mesa-dev | |
libxcursor-dev libudev-dev libxi-dev | |
clang-tidy-$CLANG_TIDY_VERSION | |
- name: Check formatting | |
run: | | |
clang-format --version | |
clang-format --dry-run --Werror src/*.cpp | |
clang-format --dry-run --Werror test/*.cpp | |
clang-format --dry-run --Werror src/*.hpp | |
clang-format --dry-run --Werror src/background/*.hpp | |
clang-format --dry-run --Werror src/background/*.cpp | |
- name: Install vcpkg packages | |
env: | |
CC: gcc-11 | |
CXX: g++-11 | |
run: | | |
./vcpkg/bootstrap-vcpkg.sh | |
./vcpkg/vcpkg install | |
- name: Create Build Environment | |
# Some projects don't allow in-source building, so create a separate build directory | |
# We'll use this as our working directory for all subsequent commands | |
run: cmake -E make_directory ${{runner.workspace}}/build | |
- name: Configure CMake | |
# Use a bash shell so we can use the same syntax for environment variable | |
# access regardless of the host operating system | |
shell: bash | |
env: | |
CC: gcc-11 | |
CXX: g++-11 | |
working-directory: ${{runner.workspace}}/build | |
run: | | |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_CLANG_TIDY=ON -DCLANG_TIDY_VERSION=$CLANG_TIDY_VERSION | |
- name: Build | |
working-directory: ${{runner.workspace}}/build | |
shell: bash | |
# Execute the build. You can specify a specific target with "--target <NAME>" | |
run: cmake --build . --config $BUILD_TYPE -- -j $(nproc) | |
- name: Test | |
working-directory: ${{runner.workspace}}/build | |
shell: bash | |
env: | |
CTEST_OUTPUT_ON_FAILURE: 1 | |
DISPLAY: :0 | |
# Execute tests defined by the CMake configuration. | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: | | |
Xvfb & | |
sleep 5 | |
ctest -C $BUILD_TYPE | |
pkill -9 Xvfb | |
- name: Clang tidy | |
working-directory: ${{runner.workspace}}/build | |
shell: bash | |
run: | | |
cmake --build . --target tidy |