mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-27 23:37:05 -05:00
git: Enable ccache for snap builds
This commit is contained in:
13
.github/workflows/build.yml
vendored
13
.github/workflows/build.yml
vendored
@@ -1045,7 +1045,7 @@ jobs:
|
||||
config_opts['plugin_conf']['ccache_enable'] = True
|
||||
config_opts['plugin_conf']['ccache_opts']['max_cache_size'] = '1G'
|
||||
config_opts['plugin_conf']['ccache_opts']['compress'] = True
|
||||
config_opts['plugin_conf']['ccache_opts']['dir'] = "$GITHUB_WORKSPACE/.ccache"
|
||||
config_opts['plugin_conf']['ccache_opts']['dir'] = "${{ github.workspace }}/.ccache"
|
||||
EOT
|
||||
|
||||
# Fedora cmake build (in imhex.spec)
|
||||
@@ -1092,7 +1092,7 @@ jobs:
|
||||
steps:
|
||||
- name: ⬇️ Install setup dependencies
|
||||
run: |
|
||||
sudo apt update && sudo apt install -y git curl
|
||||
sudo apt update && sudo apt install -y git curl ccache
|
||||
|
||||
- name: 🧰 Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -1108,9 +1108,18 @@ jobs:
|
||||
mkdir -p ./snap
|
||||
envsubst '${IMHEX_VERSION}' < ./dist/snap/snapcraft.yaml > ./snap/snapcraft.yaml
|
||||
|
||||
- name: 📜 Setup ccache
|
||||
uses: hendrikmuhs/ccache-action@v1
|
||||
with:
|
||||
key: ${{ matrix.architecture }}-snap-${{ github.run_id }}
|
||||
restore-keys: ${{ matrix.architecture }}-snap
|
||||
max-size: 1G
|
||||
|
||||
- name: 🛠️ Build
|
||||
uses: snapcore/action-build@v1
|
||||
id: snapcraft
|
||||
with:
|
||||
snapcraft-args: --mounts ccache="${{ github.workspace }}/.ccache"
|
||||
|
||||
- name: 🗝️ Generate build provenance attestations
|
||||
uses: actions/attest-build-provenance@v2
|
||||
|
||||
4
dist/snap/snapcraft.yaml
vendored
4
dist/snap/snapcraft.yaml
vendored
@@ -37,12 +37,16 @@ parts:
|
||||
build-environment:
|
||||
- CC: /usr/bin/gcc-14
|
||||
- CXX: /usr/bin/g++-14
|
||||
- CCACHE_DIR: "$CRAFT_PROJECT_DIR/../ccache"
|
||||
cmake-parameters:
|
||||
- -DCMAKE_BUILD_TYPE=Release
|
||||
- -DCMAKE_C_COMPILER_LAUNCHER=/usr/bin/ccache
|
||||
- -DCMAKE_CXX_COMPILER_LAUNCHER=/usr/bin/ccache
|
||||
cmake-generator: Ninja
|
||||
build-packages:
|
||||
- cmake
|
||||
- ninja-build
|
||||
- ccache
|
||||
- gcc-14
|
||||
- g++-14
|
||||
- git
|
||||
|
||||
Reference in New Issue
Block a user