Skip to content

Commit

Permalink
ci: add wafcache to all targets that use Waf, except Android which us…
Browse files Browse the repository at this point in the history
…es generated CMakeLists instead
  • Loading branch information
a1batross committed Nov 17, 2024
1 parent 2696dc8 commit ed39493
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,19 @@ jobs:
env:
SDL_VERSION: 2.30.3
GH_CPU_ARCH: ${{ matrix.targetarch }}
WAFCACHE_EVICT_MAX_BYTES: 1000000 # github only gives 10gb for the whole repository
WAFCACHE_STATS: 1 # enable statistics in build log
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache object files
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ matrix.targetos }}-${{ matrix.targetarch }}
path: |
~/.cache/wafcache*
- name: Install dependencies
run: bash scripts/gha/deps_${{ matrix.targetos }}.sh
- name: Build engine
Expand Down
2 changes: 1 addition & 1 deletion scripts/gha/build_apple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pushd hlsdk || die
./waf configure build install --destdir=../bin || die
popd

./waf configure --enable-utils --enable-tests --enable-lto build install --destdir=bin || die_configure
./waf configure --enable-utils --enable-tests --enable-lto --enable-wafcache build install --destdir=bin || die_configure

cp -vr /Library/Frameworks/SDL2.framework bin

Expand Down
4 changes: 2 additions & 2 deletions scripts/gha/build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ build_engine()
fi

if [ "$1" = "dedicated" ]; then
./waf configure -T release -d $AMD64 --enable-tests --enable-lto --enable-bundled-deps || die_configure
./waf configure -T release -d $AMD64 --enable-tests --enable-lto --enable-bundled-deps --enable-wafcache || die_configure
elif [ "$1" = "full" ]; then
./waf configure --sdl2=SDL2_linux -T release --enable-stb $AMD64 --enable-utils --enable-tests --enable-lto --enable-bundled-deps || die_configure
./waf configure --sdl2=SDL2_linux -T release --enable-stb $AMD64 --enable-utils --enable-tests --enable-lto --enable-bundled-deps --enable-wafcache || die_configure
else
die
fi
Expand Down
2 changes: 1 addition & 1 deletion scripts/gha/build_motomagx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pushd hlsdk || die
./waf configure -T fast --enable-magx --enable-simple-mod-hacks build install --destdir=../Xash || die
popd

./waf configure -T fast --enable-magx build install --destdir=Xash/ || die
./waf configure -T fast --enable-magx --enable-wafcache build install --destdir=Xash/ || die

cat > Xash/run.sh << 'EOF'
mypath=${0%/*}
Expand Down
2 changes: 1 addition & 1 deletion scripts/gha/build_nswitch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mkdir -p artifacts/ || die

echo "Running build script in Docker container..."

docker run --name xash-build --rm -v `pwd`:`pwd` -w `pwd` devkitpro/devkita64:latest bash ./scripts/gha/build_nswitch_docker.sh || die
docker run --name xash-build --rm -v `pwd`:`pwd` -v $HOME/.cache:$HOME/.cache -w `pwd` devkitpro/devkita64:latest bash ./scripts/gha/build_nswitch_docker.sh || die

echo "Packaging artifacts..."

Expand Down
2 changes: 1 addition & 1 deletion scripts/gha/build_nswitch_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ make -C libsolder install || die

echo "Building engine..."

./waf configure -T release --nswitch || die_configure
./waf configure -T release --nswitch --enable-wafcache || die_configure
./waf build install --destdir=pkgtemp/xash3d -v || die

echo "Building HLSDK..."
Expand Down
4 changes: 2 additions & 2 deletions scripts/gha/build_psvita.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ popd

echo "Building engine..."

./waf configure -T release --psvita || die_configure
./waf build install --destdir=pkgtemp/data/xash3d -v || die
./waf configure -T release --psvita --enable-wafcache || die_configure
./waf build install --destdir=pkgtemp/data/xash3d --zones=wafcache || die
cp build/engine/xash.vpk pkgtemp/

echo "Building HLSDK..."
Expand Down
2 changes: 1 addition & 1 deletion scripts/gha/build_win32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi

# NOTE: to build with other version use --msvc_version during configuration
# NOTE: sometimes you may need to add WinSDK to %PATH%
./waf.bat configure -s "SDL2_VC" -T release --enable-utils --enable-tests --enable-lto $AMD64 || die_configure
./waf.bat configure -s "SDL2_VC" -T release --enable-utils --enable-tests --enable-lto --enable-wafcache $AMD64 || die_configure
./waf.bat build || die
./waf.bat install --destdir=. || die

Expand Down

0 comments on commit ed39493

Please sign in to comment.