mirror of
https://github.com/Xahau/xahaud.git
synced 2026-01-18 05:35: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
|
||||
|
||||
Reference in New Issue
Block a user