Skip to content

Commit

Permalink
Merge branch 'develop' into fdr400-build-enable-macos
Browse files Browse the repository at this point in the history
  • Loading branch information
fdr400 authored Jan 11, 2025
2 parents 1d3f4c5 + 89dc74e commit 082f48e
Show file tree
Hide file tree
Showing 130 changed files with 922 additions and 443 deletions.
72 changes: 61 additions & 11 deletions .github/workflows/alpine.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Alpine Linux
name: Alpine

'on':
pull_request:
Expand All @@ -13,29 +13,53 @@ env:
ASAN_OPTIONS: detect_odr_violation=2
CXX: clang++-18
CC: clang-18
CCACHE_DIR: /home/runner/.cache/ccache
CCACHE_NOHASHDIR: true
CPM_SOURCE_CACHE: /home/runner/.cache/CPM

jobs:
posix:
strategy:
fail-fast: false

name: Build only
name: ubuntu-24.04 (build-only)
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Restore cached directories
id: restore-cache
uses: actions/cache/restore@v4
with:
path: |
${{env.CCACHE_DIR}}
${{env.CPM_SOURCE_CACHE}}
key: 'alpine-cache-dir ${{github.ref}} run-${{github.run_number}}'
restore-keys: |
alpine-cache-dir ${{github.ref}}
alpine-cache-dir
- name: Setup host cache dirs
run: |
mkdir -p ${{env.CCACHE_DIR}}
mkdir -p ${{env.CPM_SOURCE_CACHE}}
- name: Setup latest Alpine Linux
uses: jirutka/setup-alpine@v1
with:
volumes: |
${{env.CCACHE_DIR}}:${{env.CCACHE_DIR}}
${{env.CPM_SOURCE_CACHE}}:${{env.CPM_SOURCE_CACHE}}
- name: Install dependencies
shell: alpine.sh --root {0}
run: |
pwd
cat /etc/alpine-release
apk add lld
apk add lld ccache git gdb
apk add $(cat scripts/docs/en/deps/alpine.md)
- name: Install test dependencies
Expand All @@ -45,16 +69,30 @@ jobs:
redis \
rabbitmq-server \
- name: Setup caches
shell: alpine.sh --root {0}
run: |
echo "Cached CPM packages:"
du -h -d 1 ${{env.CPM_SOURCE_CACHE}}
for f in $(find ${{env.CPM_SOURCE_CACHE}} -name "cmake.lock");
do
repo=$(ls -d $(dirname $f)/*/);
echo "Repository: $repo";
git config --global --add safe.directory $repo;
done
ccache -M 2.0GB
ccache -s -v
- name: Run cmake
shell: alpine.sh {0}
shell: alpine.sh --root {0}
run: |
pwd
mkdir build_debug
cd build_debug
CMAKE_PROGRAM_PATH=/usr/lib/llvm17/bin/ \
cmake \
cmake -S . -B build_debug \
-DCMAKE_BUILD_TYPE=Debug \
-DUSERVER_USE_STATIC_LIBS=1 \
-DUSERVER_USE_LD=lld \
-DUSERVER_NO_WERROR=OFF \
-DUSERVER_BUILD_ALL_COMPONENTS=1 \
-DUSERVER_BUILD_SAMPLES=1 \
Expand All @@ -69,11 +107,23 @@ jobs:
-DUSERVER_FORCE_DOWNLOAD_ABSEIL=1 \
-DUSERVER_FORCE_DOWNLOAD_PROTOBUF=1 \
-DUSERVER_FORCE_DOWNLOAD_GRPC=1 \
-DUSERVER_USE_LD=lld \
..
- name: Compile
shell: alpine.sh --root {0}
run: |
cmake --build build_debug -j$(nproc)
- name: Save cached directories
uses: actions/cache/save@v4
with:
path: |
${{env.CCACHE_DIR}}
${{env.CPM_SOURCE_CACHE}}
key: ${{ steps.restore-cache.outputs.cache-primary-key }}

- name: Show cache stats
shell: alpine.sh {0}
run: |
cd build_debug
cmake --build . -j$(nproc)
du -h -d 1 ${{env.CCACHE_DIR}}
du -h -d 1 ${{env.CPM_SOURCE_CACHE}}
ccache -s -v
29 changes: 20 additions & 9 deletions .github/workflows/ci-conan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Ubuntu packages
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get install -y gcc g++ cmake wget git python3 python3-pip python3-venv postgresql
sudo apt-get install -y gcc g++ cmake wget git python3 python3-pip python3-venv postgresql redis clang-format
- name: Install MacOS packages
if: matrix.os == 'macos-latest'
run: |
brew update
brew install postgresql
brew install libiconv # https://stackoverflow.com/questions/57734434/libiconv-or-iconv-undefined-symbol-on-mac-osx
brew install postgresql redis clang-format
brew install [email protected]
- name: Install common packages
Expand All @@ -56,9 +53,23 @@ jobs:
- name: Test userver conan package
run: |
mv libraries/easy/samples/3_json samples/
mv scripts/tests/conanfile.py samples/
rm -rf userver/cmake/
cd samples/
USERVER_VERSION=$(conan list -c -v quiet userver/* | tail -n 1)
for SAMPLE in hello_service embedded_files postgres_service grpc_service; do
cp scripts/tests/conanfile.py samples/$SAMPLE/
conan test samples/$SAMPLE/ --build=never -s:a compiler.cppstd=17 -pr:b=default ${{matrix.conanflags}} ${USERVER_VERSION}
rm samples/$SAMPLE/conanfile.py
for SAMPLE in \
3_json \
chaotic_service \
embedded_files \
grpc_service \
hello_service \
postgres_service \
redis_service \
s3api \
; do
mv conanfile.py $SAMPLE/
conan test $SAMPLE/ --build=never -s:a compiler.cppstd=17 -pr:b=default ${{matrix.conanflags}} ${USERVER_VERSION}
mv $SAMPLE/conanfile.py ./
done
Loading

0 comments on commit 082f48e

Please sign in to comment.