feature: Store CCACHE cache in CI Cache.

This commit is contained in:
Fijxu 2024-03-14 19:45:27 -03:00
parent e29c55dd98
commit aa20f384dc
No known key found for this signature in database
GPG key ID: 32C1DDF333EDA6A4
3 changed files with 34 additions and 2 deletions

View file

@ -1,4 +1,5 @@
#!/bin/bash -ex
# SPDX-FileCopyrightText: 2019 yuzu Emulator Project
# SPDX-FileCopyrightText: 2024 suyu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
@ -6,15 +7,16 @@
# Exit on error, rather than continuing with the rest of the script.
set -e
# Old versions of ccache don't include the -v argument. Keep it only with -s
ccache -s
mkdir build || true && cd build
cmake .. \
-DBoost_USE_STATIC_LIBS=ON \
-DSUYU_USE_PRECOMPILED_HEADERS=OFF \
-DDYNARMIC_USE_PRECOMPILED_HEADERS=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_FLAGS="-march=x86-64-v2" \
-DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ \
-DCMAKE_C_COMPILER=/usr/lib/ccache/gcc \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DDISPLAY_VERSION=$1 \
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF \
@ -24,6 +26,7 @@ cmake .. \
-DSUYU_USE_BUNDLED_FFMPEG=ON \
-DSUYU_ENABLE_LTO=ON \
-DSUYU_CRASH_DUMPS=ON \
-DUSE_CCACHE=ON \
-GNinja
ninja

4
.gitignore vendored
View file

@ -39,3 +39,7 @@ Thumbs.db
# Local Gitlab CI Runner
.gitlab-ci-local/
# clangd compile_commands.json
# https://clangd.llvm.org/installation.html#project-setup
compile_commands.json

View file

@ -1,6 +1,21 @@
stages:
- format
- build
variables:
# https://docs.gitlab.com/ee/ci/runners/configure_runners.html
TRANSFER_METER_FREQUENCY: "2s"
ARTIFACT_COMPRESSION_LEVEL: "fast"
CACHE_COMPRESSION_LEVEL: "fastest"
CACHE_REQUEST_TIMEOUT: 5
# Use FASTZIP for faster compression in cache and artifacts
# https://docs.gitlab.com/runner/configuration/feature-flags.html#available-feature-flags
FF_USE_FASTZIP: true
# Our Variables
CACHE_DIR: "$CI_PROJECT_DIR/ccache"
CCACHE_DIR: $CACHE_DIR
#CLANG FORMAT - CHECKS CODE FOR FORMATTING ISSUES
clang-format:
stage: format
@ -10,11 +25,19 @@ clang-format:
script:
- git submodule update --init --depth 1 --recursive
- bash .ci/scripts/format/script.sh
#LINUX BUILD - BUILDS LINUX APPIMAGE
build-linux:
stage: build
image: registry.gitlab.com/ddutchie/ci-docker:linux-x64
resource_group: linux-ci
cache:
key: "$CI_COMMIT_REF_NAME-ccache"
paths:
- $CACHE_DIR
before_script:
- mkdir -p $CACHE_DIR
- ls -la $CACHE_DIR
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_SUBMODULE_DEPTH: 1
@ -25,6 +48,7 @@ build-linux:
artifacts:
paths:
- artifacts/*
#ANDROID BUILD - BUILDS APK
android:
stage: build
@ -39,3 +63,4 @@ android:
artifacts:
paths:
- artifacts/*