-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade main-check github action (#12)
* use predefine action for formatting * fixup! use predefine action for formatting * apply formatting * execute build and test using matrix strategy * update ftxui version
- Loading branch information
1 parent
eec51a1
commit 7da7578
Showing
7 changed files
with
113 additions
and
35 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,33 +10,99 @@ env: | |
BUILD_TYPE: Release | ||
|
||
jobs: | ||
|
||
# both tests and static analysis depend on build artifact so | ||
# they are grouped under the same job as it's simpler than cahing | ||
# or artifact upload/download. Rith now the tests are pretty fast | ||
# so not much would be gained from parallel run of test & analysis | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
compiler: ['clang','msvc','gcc'] | ||
os: ['ubuntu-latest', 'windows-latest'] | ||
exclude: | ||
- os: 'ubuntu-latest' | ||
compiler: 'msvc' | ||
- os: 'windows-latest' | ||
# temporary exclude everything | ||
# compiler: 'gcc' | ||
|
||
steps: | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/vcpkg | ||
./build/vcpkg_installed | ||
${{ env.CONAN_USER_HOME }} | ||
~/.cache/pip | ||
${{ env.HOME }}/.cache/vcpkg/archives | ||
${{ env.XDG_CACHE_HOME }}/vcpkg/archives | ||
${{ env.LOCALAPPDATA }}\vcpkg\archives | ||
${{ env.APPDATA }}\vcpkg\archives | ||
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ hashFiles('**/CMakeLists.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.compiler }} | ||
- name: Prepare environment | ||
run: sudo apt-get update && sudo apt-get install libboost-program-options-dev clang-tidy | ||
uses: aminya/setup-cpp@v1 | ||
with: | ||
compiler: ${{ matrix.compiler }} | ||
vcvarsall: ${{ contains(matrix.os, 'windows' )}} | ||
cmake: true | ||
ninja: true | ||
conan: false | ||
vcpkg: false | ||
ccache: false | ||
clangtidy: false | ||
cppcheck: false | ||
gcovr: false | ||
opencppcoverage: false | ||
|
||
- name: Configure CMake | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTS=ON | ||
- name: Setup vcpkg and install Boost (Windows) | ||
if: steps.cache-step.outputs.cache-hit != 'true' && matrix.os == 'windows-latest' | ||
|
||
run: | | ||
git clone https://github.com/microsoft/vcpkg.git | ||
cd vcpkg | ||
./bootstrap-vcpkg.bat | ||
./vcpkg install boost | ||
- name: Get boost | ||
if: matrix.os != 'windows-latest' | ||
run: sudo apt-get update && sudo apt-get install libboost-program-options-dev | ||
|
||
- name: Configure CMake (Windows) | ||
if: matrix.os == 'windows-latest' | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=On -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake | ||
|
||
- name: Configure CMake (Windows) | ||
if: matrix.os != 'windows-latest' | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=On | ||
|
||
- name: Build | ||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | ||
run: cmake --build ${{github.workspace}}/build --config Release | ||
|
||
- name: Test | ||
working-directory: ${{github.workspace}}/build | ||
working-directory: ${{ github.workspace }}/build | ||
# Exclude LocalLogRepository test as they write to the filesystem | ||
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure -E "LocalLogRepository" | ||
|
||
|
||
static-analysis: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Prepare environment | ||
run: sudo apt-get update && sudo apt-get install libboost-program-options-dev clang-tidy | ||
|
||
- name: Configure CMake | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=Off | ||
|
||
- name: Build | ||
run: cmake --build ${{github.workspace}}/build --config Release | ||
|
||
- name: Static Analysis | ||
if: always() | ||
run: ln -s ./build/compile_commands.json && run-clang-tidy ./source/ | ||
|
||
code-formatting: | ||
|
@@ -45,5 +111,8 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: clang-format | ||
run: find ./source ./test -iname '*.cpp' -o -iname '*.hpp' | xargs clang-format -n -Werror --ferror-limit=1 | ||
- uses: DoozyX/[email protected] | ||
with: | ||
source: 'source test' | ||
extensions: 'hpp,cpp' | ||
clangFormatVersion: 16 |
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
Binary file not shown.
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
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
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
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