CI improvements #2046
Workflow file for this run
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: Build Clio | |
on: | |
push: | |
branches: [master, release/*, develop] | |
pull_request: | |
branches: [master, release/*, develop] | |
workflow_dispatch: | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run clang-format | |
uses: ./.github/actions/lint | |
build_mac: | |
name: Build macOS | |
needs: lint | |
runs-on: [self-hosted, macOS] | |
env: | |
CONAN_PROFILE: clio_clang_14 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: clio | |
- name: Install dependencies | |
run: | | |
brew install llvm@14 pkg-config ninja bison cmake ccache | |
- name: Create conan profile | |
run: | | |
echo "Creating $CONAN_PROFILE conan profile"; | |
conan profile new $CONAN_PROFILE --detect --force | |
clang_path="$(brew --prefix llvm@14)/bin/clang" | |
clang_cxx_path="$(brew --prefix llvm@14)/bin/clang++" | |
conan profile update settings.compiler=clang $CONAN_PROFILE | |
conan profile update settings.compiler.version=14 $CONAN_PROFILE | |
conan profile update "conf.tools.build:compiler_executables={\"c\": \"$clang_path\", \"cpp\": \"$clang_cxx_path\"}" $CONAN_PROFILE | |
conan profile update env.CC="$clang_path" $CONAN_PROFILE | |
conan profile update env.CXX="$clang_cxx_path" $CONAN_PROFILE | |
- name: Restore conan cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: path/to/dependencies | |
key: clio-${{ runner.os }}-develop | |
- name: List conan artifactory | |
run: | | |
conan search | |
conan remote list | |
if [[ -z $(conan remote list | grep conan-non-prod) ]]; then | |
echo "Adding conan-non-prod" | |
conan remote add conan-non-prod http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod | |
else | |
echo "Conan-non-prod is available" | |
fi | |
- name: Build Clio | |
run: | | |
cd clio | |
mkdir -p build | |
cd build | |
conan install .. -of . -b missing -s build_type=Release -o clio:tests=True --profile $CONAN_PROFILE | |
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release .. -G Ninja | |
cmake --build . --parallel $(($(sysctl -n hw.logicalcpu) - 2)) | |
- name: Upload clio_tests | |
uses: actions/upload-artifact@v3 | |
with: | |
name: clio_tests_mac | |
path: ./clio/build/clio_tests | |
- name: Cleanup conan directory | |
run: | | |
conan remove "*" -s -b -f | |
# TODO(skuznetsov): upload cache only for develop branch | |
- name: Save conan cache | |
uses: actions/cache/save@v3 | |
with: | |
path: "~/.conan/data" | |
key: clio-${{ runner.os }}-develop | |
build_linux: | |
name: Build linux | |
needs: lint | |
runs-on: [self-hosted, Linux] | |
container: | |
image: conanio/gcc11:1.61.0 | |
options: --user root | |
steps: | |
- name: Get Clio | |
uses: actions/checkout@v3 | |
with: | |
path: clio | |
- name: Setup conan | |
run: | | |
conan profile new default --detect | |
conan profile update settings.compiler.cppstd=20 default | |
conan profile update settings.compiler.libcxx=libstdc++11 default | |
conan remote add --insert 0 conan-non-prod http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod | |
- name: Build Clio | |
run: | | |
cd clio | |
mkdir -p build | |
cd build | |
conan install .. -of . -b missing -s build_type=Release -o clio:tests=True | |
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release .. -G Ninja | |
cmake --build . --parallel $(($(sysctl -n hw.logicalcpu) - 2)) | |
- name: Upload clio_tests | |
uses: actions/upload-artifact@v3 | |
with: | |
name: clio_tests_linux | |
path: ./build_clio/clio_tests | |
test_mac: | |
needs: build_mac | |
runs-on: [self-hosted, macOS] | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: clio_tests_mac | |
- name: Run clio_tests | |
run: | | |
chmod +x ./clio_tests | |
./clio_tests --gtest_filter="-BackendCassandraBaseTest*:BackendCassandraTest*:BackendCassandraFactoryTestWithDB*" | |
test_linux: | |
needs: build_linux | |
runs-on: [self-hosted, x-heavy] | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: clio_tests_linux | |
- name: Run clio_tests | |
run: | | |
chmod +x ./clio_tests | |
./clio_tests --gtest_filter="-BackendCassandraBaseTest*:BackendCassandraTest*:BackendCassandraFactoryTestWithDB*" |