mirror of https://github.com/xemu-project/xemu.git
ci: Use ccache to reduce build time
This commit is contained in:
parent
70f8837912
commit
dd26bee808
|
@ -33,6 +33,20 @@ jobs:
|
||||||
sdl2 \
|
sdl2 \
|
||||||
libepoxy \
|
libepoxy \
|
||||||
coreutils \
|
coreutils \
|
||||||
pkg-config
|
pkg-config \
|
||||||
|
ccache
|
||||||
|
- name: Initialize Compiler Cache
|
||||||
|
id: cache
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: /tmp/xqemu-ccache
|
||||||
|
key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }}
|
||||||
|
restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}-
|
||||||
- name: Compile
|
- name: Compile
|
||||||
run: ./build.sh ${{ env.BUILD_PARAM }}
|
run: |
|
||||||
|
export CCACHE_DIR=/tmp/xqemu-ccache
|
||||||
|
export CCACHE_MAXSIZE=250M
|
||||||
|
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
./build.sh ${{ env.BUILD_PARAM }}
|
||||||
|
echo -e "\nCompiler Cache Stats:"
|
||||||
|
ccache -s -c
|
||||||
|
|
|
@ -28,11 +28,22 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
build-essential \
|
|
||||||
pkg-config \
|
|
||||||
libsdl2-dev \
|
libsdl2-dev \
|
||||||
libepoxy-dev \
|
libepoxy-dev \
|
||||||
zlib1g-dev \
|
libpixman-1-dev \
|
||||||
libpixman-1-dev
|
ccache
|
||||||
|
- name: Initialize Compiler Cache
|
||||||
|
id: cache
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: /tmp/xqemu-ccache
|
||||||
|
key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }}
|
||||||
|
restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}-
|
||||||
- name: Compile
|
- name: Compile
|
||||||
run: ./build.sh ${{ env.BUILD_PARAM }}
|
run: |
|
||||||
|
export CCACHE_DIR=/tmp/xqemu-ccache
|
||||||
|
export CCACHE_MAXSIZE=250M
|
||||||
|
export PATH="/usr/lib/ccache:$PATH"
|
||||||
|
./build.sh ${{ env.BUILD_PARAM }}
|
||||||
|
echo -e "\nCompiler Cache Stats:"
|
||||||
|
ccache -s -c
|
||||||
|
|
|
@ -24,32 +24,33 @@ jobs:
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
#
|
|
||||||
# An environment could be created as follows. Instead, use a pre-built
|
|
||||||
# toolchain to accelerate build times.
|
|
||||||
#
|
|
||||||
# - name: Install Dependencies
|
|
||||||
# run: |
|
|
||||||
# choco install msys2
|
|
||||||
# C:\tools\msys64\usr\bin\bash -xlc "pacman --noconfirm -S --needed base-devel git make autoconf automake-wrapper mingw-w64-x86_64-libtool mingw-w64-x86_64-pkg-config mingw-w64-x86_64-glib2 mingw-w64-x86_64-SDL2 mingw-w64-x86_64-pixman mingw-w64-x86_64-libepoxy"
|
|
||||||
# - name: Compile
|
|
||||||
# shell: cmd
|
|
||||||
# run: |
|
|
||||||
# C:\tools\msys64\usr\bin\bash -xlc "cd $GITHUB_WORKSPACE; export PATH="/mingw64/bin:$PATH"; ./build.sh"
|
|
||||||
#
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
echo "Downloading MSYS2 environment..."
|
echo "Downloading MSYS2 environment..."
|
||||||
Invoke-WebRequest -Uri "https://dl.dropboxusercontent.com/s/8lt6464xtk00t59/msys64.7z" -OutFile "msys64.7z"
|
Invoke-WebRequest -Uri "https://github.com/xqemu/ci-environment-msys2/releases/latest/download/msys64.7z" -OutFile "msys64.7z"
|
||||||
echo "Extracting MSYS2 environment..."
|
echo "Extracting MSYS2 environment..."
|
||||||
7z x -y msys64.7z "-oC:\"
|
7z x -y msys64.7z "-oC:\tools\"
|
||||||
echo "Updating MSYS2 environment..."
|
echo "Updating MSYS2 environment..."
|
||||||
C:\msys64\usr\bin\bash.exe -lc "pacman -Syu"
|
C:\tools\msys64\usr\bin\bash.exe -lc "pacman -Syu"
|
||||||
|
- name: Initialize Compiler Cache
|
||||||
|
id: cache
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: C:\tools\msys64\tmp\xqemu-ccache
|
||||||
|
key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }}
|
||||||
|
restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}-
|
||||||
- name: Compile
|
- name: Compile
|
||||||
shell: cmd
|
|
||||||
run: |
|
run: |
|
||||||
echo $GITHUB_WORKSPACE
|
C:\tools\msys64\usr\bin\bash.exe -lc @"
|
||||||
C:\msys64\usr\bin\bash.exe -lc "cd $GITHUB_WORKSPACE; export PATH="/mingw64/bin:$PATH"; ./build.sh ${{ env.BUILD_PARAM }}"
|
set -e
|
||||||
|
cd `$GITHUB_WORKSPACE
|
||||||
|
export CCACHE_DIR=/tmp/xqemu-ccache
|
||||||
|
export CCACHE_MAXSIZE=250M
|
||||||
|
export PATH="/usr/lib/ccache/bin:/mingw64/bin:`$PATH"
|
||||||
|
./build.sh ${{ env.BUILD_PARAM }}
|
||||||
|
echo -e '\nCompiler Cache Stats:'
|
||||||
|
ccache -s -c
|
||||||
|
"@
|
||||||
- name: Upload Build Artifact
|
- name: Upload Build Artifact
|
||||||
uses: actions/upload-artifact@master
|
uses: actions/upload-artifact@master
|
||||||
with:
|
with:
|
||||||
|
|
Loading…
Reference in New Issue