feat CI: consistent names and cache system for all OS, use gold for g++ #4553
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: Conan | |
'on': | |
pull_request: | |
push: | |
branches: | |
- master | |
- develop | |
- feature/** | |
env: | |
UBSAN_OPTIONS: print_stacktrace=1 | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
conanflags: '' | |
- os: macos-latest | |
conanflags: '-o python_path=python3.11' | |
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 | |
- 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 [email protected] | |
- name: Install common packages | |
run: | | |
pip install "conan==2.8.0" | |
pip install numpy | |
conan profile detect | |
conan profile show | |
- name: Run conan | |
run: | | |
conan create . --build=missing -s:a compiler.cppstd=17 -pr:b=default ${{matrix.conanflags}} | |
- name: Test userver conan package | |
run: | | |
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 | |
done |