mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Migrates the build system from Conan 1 to Conan 2: - Update all conan commands to v2 syntax (export, install, profile) - Convert profiles to Conan 2 INI format with [settings] and [conf] sections - Add tool_requires() for build tools (protobuf, grpc, b2) - Fix wasmedge/0.11.2 recipe for Conan 2 compatibility (package_id syntax) - Update CI workflows for all platforms (Linux, macOS, Docker/HBB) - Document dual Boost setup (manual for WasmEdge, Conan for app) - Force glibc-compatible builds via source compilation in HBB - Ensure dependency version consistency with override=True Maintains full backwards compatibility while preparing for Conan 1 EOL.
136 lines
4.3 KiB
YAML
136 lines
4.3 KiB
YAML
name: Nix - GA Runner
|
|
|
|
on:
|
|
push:
|
|
branches: ["dev", "candidate", "release"]
|
|
pull_request:
|
|
branches: ["dev", "candidate", "release"]
|
|
schedule:
|
|
- cron: '0 0 * * *'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-job:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
artifact_name: ${{ steps.set-artifact-name.outputs.artifact_name }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
compiler: [gcc]
|
|
configuration: [Debug]
|
|
include:
|
|
- compiler: gcc
|
|
cc: gcc-13
|
|
cxx: g++-13
|
|
compiler_id: gcc-13
|
|
compiler_version: 13
|
|
env:
|
|
build_dir: .build
|
|
# Bump this number to invalidate all caches globally.
|
|
CACHE_VERSION: 2
|
|
MAIN_BRANCH_NAME: dev
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y ninja-build ${{ matrix.cc }} ${{ matrix.cxx }} ccache
|
|
# Install Conan 2
|
|
pip install --upgrade "conan>=2.0"
|
|
|
|
- name: Configure ccache
|
|
uses: ./.github/actions/xahau-configure-ccache
|
|
with:
|
|
max_size: 2G
|
|
hash_dir: true
|
|
compiler_check: content
|
|
is_main_branch: ${{ github.ref_name == env.MAIN_BRANCH_NAME }}
|
|
|
|
- name: Configure Conan
|
|
run: |
|
|
# Create the default profile directory if it doesn't exist
|
|
mkdir -p ~/.conan2/profiles
|
|
|
|
# Create profile with our specific settings
|
|
cat > ~/.conan2/profiles/default <<EOF
|
|
[settings]
|
|
arch=x86_64
|
|
build_type=Release
|
|
compiler=${{ matrix.compiler }}
|
|
compiler.cppstd=20
|
|
compiler.libcxx=libstdc++11
|
|
compiler.version=${{ matrix.compiler_version }}
|
|
os=Linux
|
|
|
|
[buildenv]
|
|
CC=/usr/bin/${{ matrix.cc }}
|
|
CXX=/usr/bin/${{ matrix.cxx }}
|
|
|
|
[conf]
|
|
tools.build:compiler_executables={"c": "/usr/bin/${{ matrix.cc }}", "cpp": "/usr/bin/${{ matrix.cxx }}"}
|
|
EOF
|
|
|
|
# Display profile for verification
|
|
conan profile show
|
|
|
|
- name: Check environment
|
|
run: |
|
|
echo "PATH:"
|
|
echo "${PATH}" | tr ':' '\n'
|
|
which conan && conan --version || echo "Conan not found"
|
|
which cmake && cmake --version || echo "CMake not found"
|
|
which ${{ matrix.cc }} && ${{ matrix.cc }} --version || echo "${{ matrix.cc }} not found"
|
|
which ${{ matrix.cxx }} && ${{ matrix.cxx }} --version || echo "${{ matrix.cxx }} not found"
|
|
which ccache && ccache --version || echo "ccache not found"
|
|
echo "---- Full Environment ----"
|
|
env
|
|
|
|
- name: Install dependencies
|
|
uses: ./.github/actions/xahau-ga-dependencies
|
|
with:
|
|
configuration: ${{ matrix.configuration }}
|
|
build_dir: ${{ env.build_dir }}
|
|
compiler-id: ${{ matrix.compiler_id }}
|
|
cache_version: ${{ env.CACHE_VERSION }}
|
|
main_branch: ${{ env.MAIN_BRANCH_NAME }}
|
|
|
|
- name: Build
|
|
uses: ./.github/actions/xahau-ga-build
|
|
with:
|
|
generator: Ninja
|
|
configuration: ${{ matrix.configuration }}
|
|
build_dir: ${{ env.build_dir }}
|
|
cc: ${{ matrix.cc }}
|
|
cxx: ${{ matrix.cxx }}
|
|
compiler-id: ${{ matrix.compiler_id }}
|
|
cache_version: ${{ env.CACHE_VERSION }}
|
|
main_branch: ${{ env.MAIN_BRANCH_NAME }}
|
|
|
|
- name: Set artifact name
|
|
id: set-artifact-name
|
|
run: |
|
|
ARTIFACT_NAME="build-output-nix-${{ github.run_id }}-${{ matrix.compiler }}-${{ matrix.configuration }}"
|
|
echo "artifact_name=${ARTIFACT_NAME}" >> "$GITHUB_OUTPUT"
|
|
echo "Using artifact name: ${ARTIFACT_NAME}"
|
|
|
|
- name: Debug build directory
|
|
run: |
|
|
echo "Checking build directory contents: ${{ env.build_dir }}"
|
|
ls -la ${{ env.build_dir }} || echo "Build directory not found or empty"
|
|
|
|
- name: Run tests
|
|
run: |
|
|
# Ensure the binary exists before trying to run
|
|
if [ -f "${{ env.build_dir }}/rippled" ]; then
|
|
${{ env.build_dir }}/rippled --unittest --unittest-jobs $(nproc)
|
|
else
|
|
echo "Error: rippled executable not found in ${{ env.build_dir }}"
|
|
exit 1
|
|
fi
|