Skip to content

Commit

Permalink
feat ci: build in macos
Browse files Browse the repository at this point in the history
Pull Request resolved: #724
commit_hash:b013e39d996c011e1a0c9c9100bb0b13f0566b5f
  • Loading branch information
segoon committed Oct 24, 2024
1 parent 4b63e77 commit 6a3e9b5
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 2 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

'on':
pull_request:
push:
branches:
- master
- develop
- feature/**

env:
UBSAN_OPTIONS: print_stacktrace=1
ASAN_OPTIONS: detect_odr_violation=2

jobs:
macos:
name: MacOS
runs-on: macos-latest
env:
CMAKE_FLAGS: >-
-DUSERVER_SANITIZE="ub addr"
-DCMAKE_BUILD_TYPE=Debug
-DUSERVER_NO_WERROR=OFF
-DUSERVER_FEATURE_REDIS_HI_MALLOC=1
-DUSERVER_FEATURE_CRYPTOPP_BLAKE2=0
-DUSERVER_FEATURE_POSTGRESQL=0
-DUSERVER_FEATURE_GRPC=0
-DUSERVER_FEATURE_OTLP=0
-DUSERVER_FEATURE_MYSQL=0
-DUSERVER_FEATURE_RABBITMQ=0
-DUSERVER_FEATURE_ROCKS=0
-DUSERVER_FEATURE_KAFKA=0
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install brew packages
run: |
export SDKROOT="`xcrun --show-sdk-path`"
brew update
brew install $(cat scripts/docs/en/deps/macos.md)
brew install clang-format
brew link postgresql@16
- name: Run cmake
run: |
mkdir build_debug
cd build_debug
cmake $CMAKE_FLAGS ..
- name: Compile
run: |
cd build_debug
make -j$(nproc) -k
- name: Test
run: |
cd build_debug
ctest -V
2 changes: 2 additions & 0 deletions .mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
".github/workflows/cla.yml":"taxi/uservices/userver/.github/workflows/cla.yml",
".github/workflows/codeql-analysis.yml":"taxi/uservices/userver/.github/workflows/codeql-analysis.yml",
".github/workflows/docker.yaml":"taxi/uservices/userver/.github/workflows/docker.yaml",
".github/workflows/macos.yml":"taxi/uservices/userver/.github/workflows/macos.yml",
".github/workflows/publish-ubuntu-22.04-base-images.yaml":"taxi/uservices/userver/.github/workflows/publish-ubuntu-22.04-base-images.yaml",
".github/workflows/publish-ubuntu-22.04-images.yaml":"taxi/uservices/userver/.github/workflows/publish-ubuntu-22.04-images.yaml",
".gitignore":"taxi/uservices/userver/.gitignore",
Expand Down Expand Up @@ -3500,6 +3501,7 @@
"testsuite/requirements-grpc-3.txt":"taxi/uservices/userver/testsuite/requirements-grpc-3.txt",
"testsuite/requirements-grpc-4.txt":"taxi/uservices/userver/testsuite/requirements-grpc-4.txt",
"testsuite/requirements-grpc-5.txt":"taxi/uservices/userver/testsuite/requirements-grpc-5.txt",
"testsuite/requirements-internal-tests-linux.txt":"taxi/uservices/userver/testsuite/requirements-internal-tests-linux.txt",
"testsuite/requirements-internal-tests.txt":"taxi/uservices/userver/testsuite/requirements-internal-tests.txt",
"testsuite/requirements-mongo.txt":"taxi/uservices/userver/testsuite/requirements-mongo.txt",
"testsuite/requirements-postgres.txt":"taxi/uservices/userver/testsuite/requirements-postgres.txt",
Expand Down
1 change: 1 addition & 0 deletions core/functional_tests/basic_chaos/resolver_handlers.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <fmt/format.h>
#include <fmt/ranges.h>
#include <userver/clients/dns/config.hpp>
#include <userver/clients/dns/resolver.hpp>
#include <userver/clients/http/component.hpp>
Expand Down
1 change: 1 addition & 0 deletions core/src/clients/dns/resolver_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <vector>

#include <fmt/format.h>
#include <fmt/ranges.h>

#include <userver/clients/dns/config.hpp>
#include <userver/clients/dns/exception.hpp>
Expand Down
1 change: 1 addition & 0 deletions kafka/src/kafka/impl/consumer_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <chrono>

#include <fmt/format.h>
#include <fmt/ranges.h>

#include <userver/kafka/impl/configuration.hpp>
#include <userver/kafka/impl/stats.hpp>
Expand Down
2 changes: 2 additions & 0 deletions redis/src/storages/redis/component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <stdexcept>
#include <vector>

#include <fmt/ranges.h>

#include <engine/ev/thread_pool.hpp>
#include <userver/components/component.hpp>
#include <userver/components/statistics_storage.hpp>
Expand Down
1 change: 1 addition & 0 deletions redis/src/storages/redis/impl/mock_server_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <thread>

#include <fmt/format.h>
#include <fmt/ranges.h>
#include <boost/algorithm/string.hpp>

#include <userver/utest/assert_macros.hpp>
Expand Down
1 change: 1 addition & 0 deletions redis/src/storages/redis/impl/redis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#endif

#include <fmt/format.h>
#include <fmt/ranges.h>

#include <userver/logging/level.hpp>
#include <userver/logging/log.hpp>
Expand Down
1 change: 1 addition & 0 deletions redis/src/storages/redis/impl/sentinel_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <boost/crc.hpp>

#include <fmt/format.h>
#include <fmt/ranges.h>

#include <hiredis/hiredis.h>

Expand Down
2 changes: 1 addition & 1 deletion scripts/docs/en/deps/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protobuf
openssl
yaml-cpp
librdkafka
postgresql@14
postgresql@16
redis
zlib
amqp-cpp
Expand Down
4 changes: 4 additions & 0 deletions testsuite/SetupUserverTestsuiteEnv.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ userver_testsuite_requirements(REQUIREMENTS_FILES_VAR requirements_files)

list(APPEND requirements_files
"${USERVER_ROOT_DIR}/testsuite/requirements-internal-tests.txt")
if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
list(APPEND requirements_files
"${USERVER_ROOT_DIR}/testsuite/requirements-internal-tests-linux.txt")
endif()

userver_venv_setup(
NAME userver-testenv
Expand Down
1 change: 1 addition & 0 deletions testsuite/requirements-internal-tests-linux.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
netifaces >= 0.10.0
1 change: 0 additions & 1 deletion testsuite/requirements-internal-tests.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
netifaces >= 0.10.0
httpx >= 0.27.0
h2 >= 4.1.0

0 comments on commit 6a3e9b5

Please sign in to comment.