Skip to content

Commit d6cf741

Browse files
committed
Ci: Use ccache
1 parent 050e14c commit d6cf741

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

.github/workflows/.craft.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
if ($IsWindows) {
2+
if (-not ${env:HOME}) {
3+
$env:HOME = "${env:USERPROFILE}"
4+
}
25
$python = (Get-Command py).Source
36
$python=(py -c "import sys; print(sys.executable)")
47
} else {

.github/workflows/craft_override.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# creating cache files on github makes no sense
33
Packager/CreateCache = False
44

5+
6+
Paths/CCACHE_DIR = ${Env:HOME}/ccache
7+
Compile/UseCCache = True
8+
59
[BlueprintSettings]
610
# no longer preinstalled on the github images and only required to build dev-utils/breakpad-tools
711
dev-utils/python2.ignored = True

.github/workflows/main.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@ jobs:
6666
- name: Restore cache
6767
uses: actions/cache@v4
6868
with:
69-
path: ~/cache
69+
path: |
70+
~/cache
71+
~/ccache
7072
key: ${{ runner.os }}-${{ matrix.target }}
7173

7274
- name: Clone CraftMaster
73-
run: git clone --depth=1 https://invent.kde.org/kde/craftmaster.git "$env:HOME/craft/CraftMaster/CraftMaster"
75+
run: git clone --depth=1 https://invent.kde.org/kde/craftmaster.git "~/craft/CraftMaster/CraftMaster"
7476

7577
- name: Craft setup
7678
run: |
@@ -84,8 +86,18 @@ jobs:
8486
- name: Prepare
8587
run: |
8688
New-Item -ItemType Directory "${env:GITHUB_WORKSPACE}/binaries/"
89+
# bootsrtap
90+
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c craft
91+
# settings
8792
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c --set forceAsserts=true opencloud/opencloud-desktop
8893
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c --set srcDir="${env:GITHUB_WORKSPACE}" opencloud/opencloud-desktop
94+
# ccache
95+
if (-not $IsWindows) {
96+
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c dev-utils/ccache
97+
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c --run ccache -M 1GB
98+
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c --run ccache -s
99+
}
100+
# optional deployment dependencies
89101
if ($IsWindows) {
90102
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c dev-utils/nsis
91103
} elseif($IsLinux) {

0 commit comments

Comments
 (0)