mirror of
https://github.com/azerothcore/azerothcore-wotlk.git
synced 2025-12-06 02:30:26 -08:00
Share ccache across linux and docker workflows
This commit is contained in:
parent
ab8afbb3ec
commit
60a88f674e
6 changed files with 58 additions and 7 deletions
|
|
@ -37,7 +37,13 @@ runs:
|
||||||
push: ${{ inputs.push }}
|
push: ${{ inputs.push }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
target: ${{ inputs.component-name }}
|
target: ${{ inputs.component-name }}
|
||||||
|
cache-from: type=gha,scope=acore-linux
|
||||||
|
cache-to: type=gha,scope=acore-linux,mode=max
|
||||||
build-args: |
|
build-args: |
|
||||||
USER_ID=1000
|
USER_ID=1000
|
||||||
GROUP_ID=1000
|
GROUP_ID=1000
|
||||||
DOCKER_USER=acore
|
DOCKER_USER=acore
|
||||||
|
CCACHE_COMPRESS=1
|
||||||
|
CCACHE_COMPRESSLEVEL=9
|
||||||
|
CCACHE_COMPILERCHECK=content
|
||||||
|
CCACHE_MAXSIZE=5G
|
||||||
|
|
|
||||||
8
.github/actions/linux-build/action.yml
vendored
8
.github/actions/linux-build/action.yml
vendored
|
|
@ -39,18 +39,12 @@ inputs:
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: echo cache key
|
|
||||||
shell: bash
|
|
||||||
run: echo "Cache key -> ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:pch=${{ inputs.pch }}:${{ github.ref_name }}"
|
|
||||||
|
|
||||||
- name: Cache
|
- name: Cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/var/ccache
|
path: ${{ github.workspace }}/var/ccache
|
||||||
key: ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:pch=${{ inputs.pch }}:${{ github.ref_name }}
|
key: ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ github.ref_name }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:pch=${{ inputs.pch }}
|
|
||||||
ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}
|
|
||||||
ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}
|
ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}
|
||||||
|
|
||||||
# This script moves sql files from "data/sql/updates/pending_$DB" to the
|
# This script moves sql files from "data/sql/updates/pending_$DB" to the
|
||||||
|
|
|
||||||
27
.github/workflows/windows_build.yml
vendored
27
.github/workflows/windows_build.yml
vendored
|
|
@ -22,6 +22,13 @@ jobs:
|
||||||
name: ${{ matrix.os }}
|
name: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
BOOST_ROOT: C:\local\boost_1_82_0
|
BOOST_ROOT: C:\local\boost_1_82_0
|
||||||
|
AC_CCACHE: true
|
||||||
|
CCACHE_DIR: ${{ github.workspace }}/var/ccache
|
||||||
|
CCACHE_BASEDIR: ${{ github.workspace }}
|
||||||
|
CCACHE_HASHDIR: 1
|
||||||
|
CCACHE_COMPRESS: 1
|
||||||
|
CCACHE_COMPRESSLEVEL: 9
|
||||||
|
CCACHE_COMPILERCHECK: content
|
||||||
if: |
|
if: |
|
||||||
github.repository == 'azerothcore/azerothcore-wotlk'
|
github.repository == 'azerothcore/azerothcore-wotlk'
|
||||||
&& !github.event.pull_request.draft
|
&& !github.event.pull_request.draft
|
||||||
|
|
@ -30,14 +37,34 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: ccache
|
- name: ccache
|
||||||
uses: hendrikmuhs/ccache-action@v1.2.13
|
uses: hendrikmuhs/ccache-action@v1.2.13
|
||||||
|
with:
|
||||||
|
key: windows:${{ github.ref_name }}
|
||||||
|
max-size: 5G
|
||||||
|
- name: Prepare ccache directory
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p "${CCACHE_DIR}" "${CCACHE_DIR}/tmp"
|
||||||
- name: Configure OS
|
- name: Configure OS
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
CONTINUOUS_INTEGRATION: true
|
CONTINUOUS_INTEGRATION: true
|
||||||
run: |
|
run: |
|
||||||
./acore.sh install-deps
|
./acore.sh install-deps
|
||||||
|
- name: ccache config snapshot
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "==== Effective ccache configuration ===="
|
||||||
|
ccache -p | egrep 'base_dir|hash_dir|compiler_check|sloppiness|max_size' || true
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "==== Previous cache stats ===="
|
||||||
|
ccache -s || true
|
||||||
- name: Build
|
- name: Build
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -x
|
||||||
export CTOOLS_BUILD=all
|
export CTOOLS_BUILD=all
|
||||||
./acore.sh compiler build
|
./acore.sh compiler build
|
||||||
|
- name: ccache stats
|
||||||
|
shell: bash
|
||||||
|
run: ccache -s || true
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,14 @@ function comp_clean() {
|
||||||
function comp_ccacheEnable() {
|
function comp_ccacheEnable() {
|
||||||
[ "$AC_CCACHE" != true ] && return
|
[ "$AC_CCACHE" != true ] && return
|
||||||
|
|
||||||
|
local default_ccache_dir="${CCACHE_DIR:-"$AC_PATH_VAR/ccache"}"
|
||||||
|
|
||||||
|
mkdir -p "$default_ccache_dir" "$default_ccache_dir/tmp"
|
||||||
|
|
||||||
|
export CCACHE_DIR="$default_ccache_dir"
|
||||||
|
export CCACHE_TEMPDIR=${CCACHE_TEMPDIR:-"$default_ccache_dir/tmp"}
|
||||||
|
export CCACHE_BASEDIR=${CCACHE_BASEDIR:-"$AC_PATH_ROOT"}
|
||||||
|
export CCACHE_HASHDIR=${CCACHE_HASHDIR:-1}
|
||||||
export CCACHE_MAXSIZE=${CCACHE_MAXSIZE:-'1000MB'}
|
export CCACHE_MAXSIZE=${CCACHE_MAXSIZE:-'1000MB'}
|
||||||
#export CCACHE_DEPEND=true
|
#export CCACHE_DEPEND=true
|
||||||
export CCACHE_SLOPPINESS=${CCACHE_SLOPPINESS:-pch_defines,time_macros,include_file_mtime}
|
export CCACHE_SLOPPINESS=${CCACHE_SLOPPINESS:-pch_defines,time_macros,include_file_mtime}
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,20 @@ ARG CCACHE_COMPRESS=""
|
||||||
ARG CCACHE_COMPRESSLEVEL="9"
|
ARG CCACHE_COMPRESSLEVEL="9"
|
||||||
ARG CCACHE_COMPILERCHECK="content"
|
ARG CCACHE_COMPILERCHECK="content"
|
||||||
ARG CCACHE_LOGFILE=""
|
ARG CCACHE_LOGFILE=""
|
||||||
|
ARG CCACHE_BASEDIR="/azerothcore"
|
||||||
|
ARG CCACHE_HASHDIR="1"
|
||||||
|
|
||||||
|
ENV CCACHE_DIR="$CCACHE_DIR" \
|
||||||
|
CCACHE_TEMPDIR="$CCACHE_DIR/tmp" \
|
||||||
|
CCACHE_BASEDIR="$CCACHE_BASEDIR" \
|
||||||
|
CCACHE_HASHDIR="$CCACHE_HASHDIR" \
|
||||||
|
CCACHE_CPP2="$CCACHE_CPP2" \
|
||||||
|
CCACHE_MAXSIZE="$CCACHE_MAXSIZE" \
|
||||||
|
CCACHE_SLOPPINESS="$CCACHE_SLOPPINESS" \
|
||||||
|
CCACHE_COMPRESS="$CCACHE_COMPRESS" \
|
||||||
|
CCACHE_COMPRESSLEVEL="$CCACHE_COMPRESSLEVEL" \
|
||||||
|
CCACHE_COMPILERCHECK="$CCACHE_COMPILERCHECK" \
|
||||||
|
CCACHE_LOGFILE="$CCACHE_LOGFILE"
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
|
@ -88,6 +102,7 @@ RUN --mount=type=cache,target=/ccache,sharing=locked \
|
||||||
# of git repo into the container.
|
# of git repo into the container.
|
||||||
--mount=type=bind,target=/azerothcore/.git,source=.git \
|
--mount=type=bind,target=/azerothcore/.git,source=.git \
|
||||||
git config --global --add safe.directory /azerothcore \
|
git config --global --add safe.directory /azerothcore \
|
||||||
|
&& mkdir -p "$CCACHE_DIR" "$CCACHE_TEMPDIR" \
|
||||||
&& cmake /azerothcore \
|
&& cmake /azerothcore \
|
||||||
-DCMAKE_INSTALL_PREFIX="/azerothcore/env/dist" \
|
-DCMAKE_INSTALL_PREFIX="/azerothcore/env/dist" \
|
||||||
-DAPPS_BUILD="all" \
|
-DAPPS_BUILD="all" \
|
||||||
|
|
|
||||||
|
|
@ -27,3 +27,4 @@ choco install -y --skip-checksums "${INSTALL_ARGS[@]}" visualstudio2022-workloa
|
||||||
choco install -y --skip-checksums "${INSTALL_ARGS[@]}" openssl --force --version=3.5.4
|
choco install -y --skip-checksums "${INSTALL_ARGS[@]}" openssl --force --version=3.5.4
|
||||||
choco install -y --skip-checksums "${INSTALL_ARGS[@]}" boost-msvc-14.3 --force --version=1.87.0
|
choco install -y --skip-checksums "${INSTALL_ARGS[@]}" boost-msvc-14.3 --force --version=1.87.0
|
||||||
choco install -y --skip-checksums "${INSTALL_ARGS[@]}" mysql --force --version=8.4.6
|
choco install -y --skip-checksums "${INSTALL_ARGS[@]}" mysql --force --version=8.4.6
|
||||||
|
choco install -y --skip-checksums "${INSTALL_ARGS[@]}" ccache
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue