Skip to content

Commit b19064c

Browse files
committed
Ci: Use ccache
1 parent 952fbac commit b19064c

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-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: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,17 @@ 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: |
76+
if ($IsWindows -and (-not ${env:HOME})) {
77+
$env:HOME = "${env:USERPROFILE}"
78+
}
79+
git clone --depth=1 https://invent.kde.org/kde/craftmaster.git "${env:HOME}/craft/CraftMaster/CraftMaster"
7480
7581
- name: Craft setup
7682
run: |
@@ -84,8 +90,18 @@ jobs:
8490
- name: Prepare
8591
run: |
8692
New-Item -ItemType Directory "${env:GITHUB_WORKSPACE}/binaries/"
93+
# bootsrtap
94+
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c craft
95+
# settings
8796
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c --set forceAsserts=true opencloud/opencloud-desktop
8897
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c --set srcDir="${env:GITHUB_WORKSPACE}" opencloud/opencloud-desktop
98+
# ccache
99+
if (-not $IsWindows) {
100+
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c dev-utils/ccache
101+
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c --run "ccache -M1GB"
102+
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c --run "ccache -s"
103+
}
104+
# optional deployment dependencies
89105
if ($IsWindows) {
90106
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c dev-utils/nsis
91107
} elseif($IsLinux) {

0 commit comments

Comments
 (0)