Compare commits

...

3 commits

Author SHA1 Message Date
44a2e172ed
fix: Use chmod inside the CCACHE directory
If we need to replace the docker image for any reason, the user will
(probably) be different. This ensures that the CCACHE directory can be
read and writen by any user of the docker image being used in the CI.
2024-03-14 20:32:16 -03:00
90ab1c3882
fix: Re add CMAKE_CXX_COMPILER and CMAKE_C_COMPILER. Now pointing to
GCC12.
2024-03-14 20:08:51 -03:00
aa20f384dc
feature: Store CCACHE cache in CI Cache. 2024-03-14 19:45:27 -03:00
3 changed files with 37 additions and 2 deletions

View file

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

4
.gitignore vendored
View file

@ -39,3 +39,7 @@ Thumbs.db
# Local Gitlab CI Runner # Local Gitlab CI Runner
.gitlab-ci-local/ .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: stages:
- format - format
- build - 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 - CHECKS CODE FOR FORMATTING ISSUES
clang-format: clang-format:
stage: format stage: format
@ -10,11 +25,20 @@ clang-format:
script: script:
- git submodule update --init --depth 1 --recursive - git submodule update --init --depth 1 --recursive
- bash .ci/scripts/format/script.sh - bash .ci/scripts/format/script.sh
#LINUX BUILD - BUILDS LINUX APPIMAGE #LINUX BUILD - BUILDS LINUX APPIMAGE
build-linux: build-linux:
stage: build stage: build
image: registry.gitlab.com/ddutchie/ci-docker:linux-x64 image: registry.gitlab.com/ddutchie/ci-docker:linux-x64
resource_group: linux-ci resource_group: linux-ci
cache:
key: "$CI_COMMIT_REF_NAME-ccache"
paths:
- $CACHE_DIR
before_script:
- mkdir -p $CACHE_DIR
- chmod -R 777 $CACHE_DIR
- ls -la $CACHE_DIR
variables: variables:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
GIT_SUBMODULE_DEPTH: 1 GIT_SUBMODULE_DEPTH: 1
@ -25,6 +49,7 @@ build-linux:
artifacts: artifacts:
paths: paths:
- artifacts/* - artifacts/*
#ANDROID BUILD - BUILDS APK #ANDROID BUILD - BUILDS APK
android: android:
stage: build stage: build
@ -39,3 +64,4 @@ android:
artifacts: artifacts:
paths: paths:
- artifacts/* - artifacts/*