From 7874531ea9c54dd42d00e77195fdb811aa6b8f0c Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Tue, 7 Apr 2020 18:17:46 -0500 Subject: [PATCH 1/2] CMakeLists should not know anything about ccache --- benchmarks/CMakeLists.txt | 7 ------- examples/CMakeLists.txt | 7 ------- scripts/build.sh | 4 ++++ tests/CMakeLists.txt | 7 ------- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index f21e681f7..be2439db5 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -1,10 +1,3 @@ -find_program(CCACHE_FOUND ccache) - -if(CCACHE_FOUND) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) -endif() - add_executable(ozo_benchmark ozo_benchmark.cpp) target_link_libraries(ozo_benchmark ozo) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index c5c2fdb3f..465eea6e3 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,10 +1,3 @@ -find_program(CCACHE_FOUND ccache) - -if(CCACHE_FOUND) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) -endif() - add_executable(ozo_request request.cpp) target_link_libraries(ozo_request ozo) diff --git a/scripts/build.sh b/scripts/build.sh index 667bfad87..653a19cd0 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -112,6 +112,8 @@ build() { mkdir -p ${BUILD_DIR} cd ${BUILD_DIR} cmake \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER="${CC_COMPILER}" \ -DCMAKE_CXX_COMPILER="${CXX_COMPILER}" \ -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS"\ @@ -148,6 +150,8 @@ build() { mkdir -p ${EXT_BUILD_DIR} cd ${EXT_BUILD_DIR} cmake \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER="${CC_COMPILER}" \ -DCMAKE_CXX_COMPILER="${CXX_COMPILER}" \ -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3141832ce..3eaa619fd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,3 @@ -find_program(CCACHE_FOUND ccache) - include(ExternalProject) ExternalProject_Add( GoogleTest @@ -83,11 +81,6 @@ target_link_libraries(ozo_tests gmock) target_link_libraries(ozo_tests ozo) add_test(ozo_tests ozo_tests) -if(CCACHE_FOUND) - set_target_properties(ozo_tests PROPERTIES RULE_LAUNCH_COMPILE ccache) - set_target_properties(ozo_tests PROPERTIES RULE_LAUNCH_LINK ccache) -endif() - # enable useful warnings and errors target_compile_options(ozo_tests PRIVATE -Wall -Wextra -pedantic -Werror) From 494e535046b34c649db717d41513119618091888 Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Tue, 7 Apr 2020 17:27:31 -0500 Subject: [PATCH 2/2] Add initial GitHub Actions configuration file --- .github/workflows/linux.yml | 37 +++++++++++++++++++++++++++++++++++++ .github/workflows/macos.yml | 27 +++++++++++++++++++++++++++ scripts/build.sh | 4 ---- 3 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/linux.yml create mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 000000000..b31bde772 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,37 @@ +name: Linux + +on: + pull_request: + push: + release: + types: published + +jobs: + linux: + runs-on: [ubuntu-latest] + strategy: + matrix: + pattern: + - 'pg docker gcc debug' + - 'pg docker gcc release' + - 'pg docker gcc test_external_project' + - 'pg docker clang debug' + - 'pg docker clang release' + - 'pg docker clang asan' + - 'pg docker clang ubsan' + - 'pg docker clang tsan' + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + - name: Install dependencies + run: | + sudo sed -i 's/azure\.//' /etc/apt/sources.list + sudo apt update + sudo apt install -y python3-setuptools + pip3 install --user docker-compose + + - name: Build OZO + shell: bash + run: | + scripts/build.sh ${{ matrix.pattern }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 000000000..a6502b79b --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,27 @@ +name: Mac OS X + +on: + pull_request: + push: + release: + types: published + +jobs: + macos: + runs-on: [macos-latest] + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + - name: Install dependencies + run: | + sudo chown -R $(whoami) $(brew --prefix)/* + brew unlink libpq + brew install --force boost postgresql || brew link --overwrite postgresql + + - name: Build OZO + env: + BOOSTROOT: /usr + shell: bash + run: | + scripts/build.sh clang debug diff --git a/scripts/build.sh b/scripts/build.sh index 653a19cd0..667bfad87 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -112,8 +112,6 @@ build() { mkdir -p ${BUILD_DIR} cd ${BUILD_DIR} cmake \ - -DCMAKE_C_COMPILER_LAUNCHER=ccache \ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER="${CC_COMPILER}" \ -DCMAKE_CXX_COMPILER="${CXX_COMPILER}" \ -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS"\ @@ -150,8 +148,6 @@ build() { mkdir -p ${EXT_BUILD_DIR} cd ${EXT_BUILD_DIR} cmake \ - -DCMAKE_C_COMPILER_LAUNCHER=ccache \ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER="${CC_COMPILER}" \ -DCMAKE_CXX_COMPILER="${CXX_COMPILER}" \ -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \