1
0
Fork 0

CI: add caching

This commit is contained in:
liushuyu 2021-12-26 19:30:33 -07:00
parent 58f630b63f
commit 4eb11b49b0
No known key found for this signature in database
GPG Key ID: 23D1CE4534419437
3 changed files with 15 additions and 3 deletions

View File

@ -11,11 +11,18 @@ CFLAGS="-ftree-vectorize -flto"
if [[ "$(uname -m)" == "aarch64" ]]; then
CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
fi
if [[ "$USE_CCACHE" != '0' ]]; then
echo '[+] Enabled ccache'
ccache -s
export CC='/usr/lib/ccache/gcc'
export CXX='/usr/lib/ccache/g++'
fi
export CFLAGS
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-flto -fuse-linker-plugin"
mkdir -p build && cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DENABLE_QT=OFF -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF -DUSE_DISCORD_PRESENCE=OFF -DENABLE_FFMPEG_VIDEO_DUMPER=OFF
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DENABLE_SDL2=OFF -DENABLE_QT=OFF -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF -DUSE_DISCORD_PRESENCE=OFF -DENABLE_FFMPEG_VIDEO_DUMPER=OFF
ninja citra-room
strip ./bin/Release/citra-room

View File

@ -36,3 +36,5 @@ jobs:
platforms: linux/${{ matrix.arch }}
push: ${{ (github.ref == 'refs/heads/master') && (github.repository == 'citra-emu/citra-multiplayer-dedicated') }}
tags: citraemu/citra-multiplayer-dedicated:latest
cache-from: type=gha,scope=buildkit-${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=buildkit-${{ matrix.arch }}

View File

@ -1,11 +1,14 @@
# syntax=docker/dockerfile:1.3
FROM debian:bullseye AS build
ENV DEBIAN_FRONTEND=noninteractive
ARG USE_CCACHE
RUN apt-get update && apt-get -y full-upgrade && \
apt-get install -y build-essential libsdl2-dev wget git ccache cmake ninja-build
apt-get install -y build-essential wget git ccache cmake ninja-build
COPY . /root/build-files
RUN git clone --recursive https://github.com/citra-emu/citra-canary.git /root/citra-canary && \
RUN --mount=type=cache,id=ccache,target=/root/.ccache \
git clone --depth 1000 --recursive https://github.com/citra-emu/citra-canary.git /root/citra-canary && \
cd /root/citra-canary && /root/build-files/.ci/build.sh
FROM debian:bullseye-slim AS final