mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
[GA] conan mac os build
This commit is contained in:
21
.github/actions/dependencies/action.yml
vendored
21
.github/actions/dependencies/action.yml
vendored
@@ -2,7 +2,8 @@ name: dependencies
|
|||||||
inputs:
|
inputs:
|
||||||
configuration:
|
configuration:
|
||||||
required: true
|
required: true
|
||||||
# An implicit input is the environment variable `build_dir`.
|
cache-key:
|
||||||
|
required: true
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
@@ -11,7 +12,18 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
conan export external/snappy snappy/1.1.9@
|
conan export external/snappy snappy/1.1.9@
|
||||||
conan export external/soci soci/4.0.3@
|
conan export external/soci soci/4.0.3@
|
||||||
|
|
||||||
|
- name: Restore Conan cache
|
||||||
|
id: cache-restore
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: ~/.conan/data
|
||||||
|
key: ${{ inputs.cache-key }}-${{ inputs.configuration }}-conan-${{ hashFiles('conanfile.py') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-conan-
|
||||||
|
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
|
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir ${build_dir}
|
mkdir ${build_dir}
|
||||||
@@ -21,3 +33,10 @@ runs:
|
|||||||
--build missing \
|
--build missing \
|
||||||
--settings build_type=${{ inputs.configuration }} \
|
--settings build_type=${{ inputs.configuration }} \
|
||||||
..
|
..
|
||||||
|
|
||||||
|
- name: Save Conan cache
|
||||||
|
if: steps.cache-restore.outputs.cache-hit != 'true' && success()
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: ~/.conan/data
|
||||||
|
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
|
||||||
|
|||||||
119
.github/workflows/macos.ga.yml
vendored
Normal file
119
.github/workflows/macos.ga.yml
vendored
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
name: MacOS CI
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
generator:
|
||||||
|
- Ninja
|
||||||
|
configuration:
|
||||||
|
- Debug
|
||||||
|
runs-on: [self-hosted, macOS, ARM64]
|
||||||
|
env:
|
||||||
|
build_dir: .build
|
||||||
|
deps_dir: .build-deps
|
||||||
|
NUM_PROCESSORS: 12
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Conan
|
||||||
|
run: |
|
||||||
|
brew install conan@1
|
||||||
|
echo "$(brew --prefix conan@1)/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Install Coreutils
|
||||||
|
run: |
|
||||||
|
brew install coreutils
|
||||||
|
echo "Num proc: $(nproc)"
|
||||||
|
|
||||||
|
- name: Install Ninja
|
||||||
|
if: matrix.generator == 'Ninja'
|
||||||
|
run: brew install ninja
|
||||||
|
|
||||||
|
- name: Install Python
|
||||||
|
run: |
|
||||||
|
if which python3 > /dev/null 2>&1; then
|
||||||
|
echo "Python 3 executable exists"
|
||||||
|
python3 --version
|
||||||
|
else
|
||||||
|
brew install python@3.12
|
||||||
|
fi
|
||||||
|
# Create python symlink if needed
|
||||||
|
if ! which python > /dev/null 2>&1; then
|
||||||
|
sudo ln -sf $(which python3) /usr/local/bin/python
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Install CMake
|
||||||
|
run: |
|
||||||
|
if which cmake > /dev/null 2>&1; then
|
||||||
|
echo "cmake executable exists"
|
||||||
|
cmake --version
|
||||||
|
else
|
||||||
|
brew install cmake
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Check environment
|
||||||
|
run: |
|
||||||
|
echo "PATH:"
|
||||||
|
echo ${PATH} | tr ':' '\n'
|
||||||
|
which python
|
||||||
|
python --version
|
||||||
|
which conan
|
||||||
|
conan --version
|
||||||
|
which cmake
|
||||||
|
cmake --version
|
||||||
|
clang --version
|
||||||
|
env
|
||||||
|
|
||||||
|
- name: Configure Conan
|
||||||
|
run: |
|
||||||
|
conan profile new default --detect || true
|
||||||
|
conan profile update settings.compiler.cppstd=20 default
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
uses: ./.github/actions/dependencies
|
||||||
|
with:
|
||||||
|
configuration: ${{ matrix.configuration }}
|
||||||
|
cache-key: macos-${{ matrix.platform }}-${{ matrix.generator }}
|
||||||
|
env:
|
||||||
|
build_dir: ${{ env.deps_dir }}
|
||||||
|
|
||||||
|
- name: Generate safe branch name
|
||||||
|
id: safe-branch
|
||||||
|
run: |
|
||||||
|
# Replace characters that aren't allowed in cache keys
|
||||||
|
SAFE_BRANCH=$(echo "${{ github.ref_name }}" | tr -c 'a-zA-Z0-9_.-' '-')
|
||||||
|
echo "name=${SAFE_BRANCH}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Restore build directory cache
|
||||||
|
id: build-cache-restore
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: ${{ env.build_dir }}
|
||||||
|
key: ${{ runner.os }}-build-${{ matrix.configuration }}-${{ steps.safe-branch.outputs.name }}-${{ hashFiles('**/conanfile.txt', '**/conanfile.py') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-build-${{ matrix.configuration }}-${{ steps.safe-branch.outputs.name }}-
|
||||||
|
${{ runner.os }}-build-${{ matrix.configuration }}-
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
uses: ./.github/actions/build
|
||||||
|
with:
|
||||||
|
generator: ${{ matrix.generator }}
|
||||||
|
configuration: ${{ matrix.configuration }}
|
||||||
|
|
||||||
|
- name: Save build directory cache
|
||||||
|
if: success()
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: ${{ env.build_dir }}
|
||||||
|
key: ${{ steps.build-cache-restore.outputs.cache-primary-key }}
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
${build_dir}/rippled --unittest --unittest-jobs $(nproc)
|
||||||
Reference in New Issue
Block a user