fix:Synchronize config content#117 #48
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: kiwi | |
on: | |
push: | |
branches: [ "unstable" ] | |
pull_request: | |
branches: [ "*" ] | |
env: | |
BUILD_DIR: cmake-build-release | |
jobs: | |
check_format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: bash ./etc/script/ci/build.sh | |
- name: Add LLVM apt repository | |
run: | | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" | sudo tee /etc/apt/sources.list.d/llvm.list | |
sudo apt update | |
- name: Install clang-format-18 | |
run: | | |
sudo apt install -y clang-format-18 | |
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-18 200 | |
- name: Verify clang-format version | |
run: clang-format --version | |
- name: Check Format | |
working-directory: ${{ github.workspace }}/build | |
run: make check-format | |
build_on_macos: | |
runs-on: macos-14 | |
needs: check_format | |
env: | |
CMAKE_C_COMPILER_LAUNCHER: "ccache" | |
CMAKE_CXX_COMPILER_LAUNCHER: "ccache" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
brew update | |
brew install ccache | |
brew install autoconf | |
brew install go | |
- name: Configure ccache | |
run: | | |
ccache --set-config=cache_dir=$HOME/.ccache | |
ccache --max-size=10G | |
- name: Restore ccache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.ccache | |
key: ${{ runner.os }}-ccache-${{ hashFiles('**/*.cpp','**/*.cc','**/*.c', '**/*.h') }}-clang | |
restore-keys: | | |
${{ runner.os }}-ccache- | |
ccache- | |
- name: Build | |
run: | | |
export LIBRARY_PATH=$(xcrun --show-sdk-path)/usr/lib | |
export DYLD_LIBRARY_PATH=$(xcrun --show-sdk-path)/usr/lib | |
bash ./etc/script/build.sh --verbose | |
- name: Save ccache stats | |
run: ccache -s | |
- name: GTest | |
working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }} | |
# Execute tests defined by the CMake configuration. | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: ctest | |
- name: Run TCL E2e Tests | |
working-directory: ${{ github.workspace }} | |
run: | |
./etc/script/kiwitests.sh all | |
- name: Run Go E2E Tests | |
working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }} | |
run: | | |
set +e | |
cd ../tests | |
go mod tidy | |
go test -timeout 15m --ginkgo.v | |
sh print_log.sh | |
build_on_ubuntu: | |
runs-on: ubuntu-latest | |
needs: check_format | |
env: | |
CMAKE_C_COMPILER_LAUNCHER: "ccache" | |
CMAKE_CXX_COMPILER_LAUNCHER: "ccache" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: sudo apt install -y ccache | |
- name: Configure ccache | |
run: | | |
ccache --set-config=cache_dir=$HOME/.ccache | |
ccache --max-size=10G | |
- name: Restore ccache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.ccache | |
key: ${{ runner.os }}-ccache-${{ hashFiles('**/*.cpp','**/*.cc','**/*.c', '**/*.h') }}-${{ matrix.compiler || 'gcc' }} | |
restore-keys: | | |
${{ runner.os }}-ccache- | |
ccache- | |
- name: Build | |
run: | | |
bash ./etc/script/build.sh --verbose | |
- name: Save ccache stats | |
run: ccache -s | |
- name: GTest | |
working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }} | |
# Execute tests defined by the CMake configuration. | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: ctest | |
- name: Run TCL E2e Tests | |
working-directory: ${{ github.workspace }} | |
run: | |
./etc/script/kiwitests.sh all | |
- name: Run Go E2E Tests | |
working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }} | |
run: | | |
set +e | |
cd ../tests | |
go mod tidy | |
go test -timeout 15m --ginkgo.v || exit 1 | |
sh print_log.sh |