mirror of
https://github.com/Xahau/xahaud.git
synced 2026-01-18 13:45:16 +00:00
Compare commits
6 Commits
workflow-l
...
self-hoste
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
063ce3eaef | ||
|
|
2000c514a4 | ||
|
|
d4f4c2bc6c | ||
|
|
1b86cdc256 | ||
|
|
01bacf90a6 | ||
|
|
2162674931 |
12
.github/actions/xahau-ga-build/action.yml
vendored
12
.github/actions/xahau-ga-build/action.yml
vendored
@@ -28,8 +28,8 @@ inputs:
|
||||
description: 'Cache version for invalidation'
|
||||
required: false
|
||||
default: '1'
|
||||
cache_enabled:
|
||||
description: 'Whether to use cache'
|
||||
gha_cache_enabled:
|
||||
description: 'Whether to use actions/cache (disable for self-hosted with volume mounts)'
|
||||
required: false
|
||||
default: 'true'
|
||||
ccache_enabled:
|
||||
@@ -76,7 +76,7 @@ runs:
|
||||
echo "name=${SAFE_BRANCH}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Restore ccache directory for main branch
|
||||
if: inputs.cache_enabled == 'true' && inputs.ccache_enabled == 'true'
|
||||
if: inputs.gha_cache_enabled == 'true' && inputs.ccache_enabled == 'true'
|
||||
id: ccache-restore
|
||||
uses: ./.github/actions/xahau-ga-cache-restore
|
||||
with:
|
||||
@@ -88,7 +88,7 @@ runs:
|
||||
cache-type: ccache-main
|
||||
|
||||
- name: Restore ccache directory for current branch
|
||||
if: inputs.cache_enabled == 'true' && inputs.ccache_enabled == 'true' && steps.safe-branch.outputs.name != inputs.main_branch
|
||||
if: inputs.gha_cache_enabled == 'true' && inputs.ccache_enabled == 'true' && steps.safe-branch.outputs.name != inputs.main_branch
|
||||
id: ccache-restore-current-branch
|
||||
uses: ./.github/actions/xahau-ga-cache-restore
|
||||
with:
|
||||
@@ -246,14 +246,14 @@ runs:
|
||||
run: ccache -s
|
||||
|
||||
- name: Save ccache directory for main branch
|
||||
if: success() && inputs.cache_enabled == 'true' && inputs.ccache_enabled == 'true' && steps.safe-branch.outputs.name == inputs.main_branch
|
||||
if: success() && inputs.gha_cache_enabled == 'true' && inputs.ccache_enabled == 'true' && steps.safe-branch.outputs.name == inputs.main_branch
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: ~/.ccache-main
|
||||
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
|
||||
|
||||
- name: Save ccache directory for current branch
|
||||
if: success() && inputs.cache_enabled == 'true' && inputs.ccache_enabled == 'true' && steps.safe-branch.outputs.name != inputs.main_branch
|
||||
if: success() && inputs.gha_cache_enabled == 'true' && inputs.ccache_enabled == 'true' && steps.safe-branch.outputs.name != inputs.main_branch
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: ~/.ccache-current
|
||||
|
||||
10
.github/actions/xahau-ga-dependencies/action.yml
vendored
10
.github/actions/xahau-ga-dependencies/action.yml
vendored
@@ -17,8 +17,8 @@ inputs:
|
||||
description: 'Cache version for invalidation'
|
||||
required: false
|
||||
default: '1'
|
||||
cache_enabled:
|
||||
description: 'Whether to use caching'
|
||||
gha_cache_enabled:
|
||||
description: 'Whether to use actions/cache (disable for self-hosted with volume mounts)'
|
||||
required: false
|
||||
default: 'true'
|
||||
main_branch:
|
||||
@@ -64,7 +64,7 @@ runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Restore Conan cache
|
||||
if: inputs.cache_enabled == 'true'
|
||||
if: inputs.gha_cache_enabled == 'true'
|
||||
id: cache-restore-conan
|
||||
uses: ./.github/actions/xahau-ga-cache-restore
|
||||
with:
|
||||
@@ -77,7 +77,7 @@ runs:
|
||||
cache-type: Conan
|
||||
|
||||
- name: Configure Conan cache paths
|
||||
if: inputs.cache_enabled == 'false'
|
||||
if: inputs.gha_cache_enabled == 'false'
|
||||
shell: bash
|
||||
# For self-hosted runners, register cache paths to be used as volumes
|
||||
# This allows the cache to be shared between containers
|
||||
@@ -163,7 +163,7 @@ runs:
|
||||
..
|
||||
|
||||
- name: Save Conan cache
|
||||
if: success() && inputs.cache_enabled == 'true' && steps.cache-restore-conan.outputs.cache-hit != 'true'
|
||||
if: success() && inputs.gha_cache_enabled == 'true' && steps.cache-restore-conan.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: ~/.conan2
|
||||
|
||||
35
.github/workflows/xahau-ga-nix.yml
vendored
35
.github/workflows/xahau-ga-nix.yml
vendored
@@ -174,8 +174,23 @@ jobs:
|
||||
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
|
||||
f.write(f"matrix={output}\n")
|
||||
|
||||
apt-cache:
|
||||
runs-on: [self-hosted, generic, 20.04]
|
||||
container:
|
||||
image: ubuntu:24.04
|
||||
volumes:
|
||||
- /home/runner/.apt-cache:/var/cache/apt
|
||||
steps:
|
||||
- name: Install build dependencies to save apt cache
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y software-properties-common
|
||||
add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||
apt-get update
|
||||
apt-get install -y python3 python-is-python3 pipx cmake ninja-build ccache perl libsqlite3-dev
|
||||
|
||||
build:
|
||||
needs: matrix-setup
|
||||
needs: [matrix-setup, apt-cache]
|
||||
runs-on: [self-hosted, generic, 20.04]
|
||||
container:
|
||||
image: ubuntu:24.04
|
||||
@@ -183,8 +198,8 @@ jobs:
|
||||
- /home/runner/.conan-cache:/.conan-cache
|
||||
- /home/runner/.ccache-main:/github/home/.ccache-main
|
||||
- /home/runner/.ccache-current:/github/home/.ccache-current
|
||||
options: >-
|
||||
--privileged
|
||||
# apt cache as readonly
|
||||
- /home/runner/.apt-cache:/apt-cache-ro:ro
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
@@ -202,8 +217,18 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Seed apt cache
|
||||
run: |
|
||||
# prepare apt cache directory
|
||||
mkdir -p /var/cache/apt/archives
|
||||
|
||||
# copy existing .deb files from apt cache
|
||||
mkdir -p /var/cache/apt/archives
|
||||
cp -a /apt-cache-ro/archives/. /var/cache/apt/archives/
|
||||
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
# install dependencies from apt cache
|
||||
apt-get update
|
||||
apt-get install -y software-properties-common
|
||||
add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||
@@ -312,7 +337,7 @@ jobs:
|
||||
cc: ${{ matrix.cc }}
|
||||
cxx: ${{ matrix.cxx }}
|
||||
stdlib: ${{ matrix.stdlib }}
|
||||
cache_enabled: 'false' # Disable caching for self hosted runner
|
||||
gha_cache_enabled: 'false' # Disable caching for self hosted runner
|
||||
|
||||
- name: Build
|
||||
uses: ./.github/actions/xahau-ga-build
|
||||
@@ -327,7 +352,7 @@ jobs:
|
||||
main_branch: ${{ env.MAIN_BRANCH_NAME }}
|
||||
stdlib: ${{ matrix.stdlib }}
|
||||
clang_gcc_toolchain: ${{ matrix.clang_gcc_toolchain || '' }}
|
||||
cache_enabled: 'false' # Disable caching for self hosted runner
|
||||
gha_cache_enabled: 'false' # Disable caching for self hosted runner
|
||||
ccache_max_size: '100G'
|
||||
|
||||
- name: Set artifact name
|
||||
|
||||
@@ -149,7 +149,6 @@ if (use_gold AND is_gcc)
|
||||
required to make gold play nicely with jemalloc.
|
||||
#]=========================================================]
|
||||
if (("${LD_VERSION}" MATCHES "GNU gold") AND (NOT jemalloc))
|
||||
message(STATUS "Using gold linker")
|
||||
target_link_libraries (common
|
||||
INTERFACE
|
||||
-fuse-ld=gold
|
||||
@@ -171,7 +170,6 @@ if (use_lld)
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -fuse-ld=lld -Wl,--version
|
||||
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||
if ("${LD_VERSION}" MATCHES "LLD")
|
||||
message(STATUS "Using lld linker")
|
||||
target_link_libraries (common INTERFACE -fuse-ld=lld)
|
||||
endif ()
|
||||
unset (LD_VERSION)
|
||||
|
||||
@@ -67,8 +67,9 @@ fi
|
||||
# Environment setup moved to Dockerfile in release-builder.sh
|
||||
source /opt/rh/gcc-toolset-11/enable
|
||||
export PATH=/usr/local/bin:$PATH
|
||||
export PATH=/usr/lib/ccache:$PATH
|
||||
echo "-- Build Rippled --"
|
||||
export CC='ccache gcc' &&
|
||||
export CXX='ccache g++' &&
|
||||
echo "-- Build Rippled --" &&
|
||||
pwd &&
|
||||
|
||||
echo "MOVING TO [ build-core.sh ]";
|
||||
|
||||
@@ -128,6 +128,9 @@ ENV CMAKE_EXE_LINKER_FLAGS="-static-libstdc++"
|
||||
ENV LLVM_DIR=/usr/lib64/llvm14/lib/cmake/llvm
|
||||
ENV WasmEdge_LIB=/usr/local/lib64/libwasmedge.a
|
||||
|
||||
ENV CC='ccache gcc'
|
||||
ENV CXX='ccache g++'
|
||||
|
||||
# Install LLD
|
||||
RUN /hbb_exe/activate-exec bash -c "source /opt/rh/gcc-toolset-11/enable && \
|
||||
cd /tmp && \
|
||||
@@ -186,7 +189,6 @@ RUN cd /tmp && \
|
||||
|
||||
# Set environment variables
|
||||
ENV PATH=/usr/local/bin:$PATH
|
||||
ENV PATH=/usr/lib/ccache:$PATH
|
||||
|
||||
# Configure ccache and Conan 2
|
||||
# NOTE: Using echo commands instead of heredocs because heredocs in Docker RUN commands are finnicky
|
||||
|
||||
Reference in New Issue
Block a user