Skip to content

Commit b97e87e

Browse files
committed
ci: complete the conda toolchain deps and add compiler + CPM caching
conda's llvmdev pulls runtime-only libzlib/libxml2 (no headers), so the LLVM config's find_package(ZLIB)/find_package(LibXml2) came up empty on Windows, which has no system fallback (Linux was masked by the runner's system dev packages). Add zlib/zstd/libxml2-devel to the toolchain env so the transitive imported targets (ZLIB::ZLIB, LibXml2::LibXml2) resolve on both platforms. Also cache the compiler output and dependency downloads: ccache (Linux) and sccache (Windows) via CMAKE_<LANG>_COMPILER_LAUNCHER, plus a CPM_SOURCE_CACHE so the CPM libraries are not re-downloaded each run.
1 parent be25027 commit b97e87e

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/build-linux.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,18 @@ jobs:
3838
llvmdev=20.1
3939
clangdev=20.1
4040
lld=20.1
41+
zlib
42+
zstd
43+
libxml2-devel
4144
init-shell: bash
4245
cache-environment: true
4346

47+
- name: Setup ccache
48+
uses: hendrikmuhs/ccache-action@v1.2
49+
with:
50+
key: ${{ github.job }}-${{ runner.os }}
51+
max-size: 2G
52+
4453
- name: Cache AnyDSL toolchain (thorin/artic/runtime)
4554
uses: actions/cache@v4
4655
with:
@@ -49,20 +58,31 @@ jobs:
4958
restore-keys: |
5059
anydsl-deps-${{ runner.os }}-
5160
61+
- name: Cache CPM sources
62+
uses: actions/cache@v4
63+
with:
64+
path: .cpm-cache
65+
key: cpm-${{ runner.os }}-${{ hashFiles('cmake/Dependencies.cmake') }}
66+
restore-keys: |
67+
cpm-${{ runner.os }}-
68+
5269
- name: Generate CI setup config
5370
shell: bash -el {0}
5471
run: |
5572
pwsh -NoProfile -Command '
5673
$cfg = Get-Content scripts/setup/config.json -Raw | ConvertFrom-Json
5774
$cfg.LOCATION = "$env:GITHUB_WORKSPACE/deps"
5875
$cfg.LLVM.SYSTEM_DIR = "$env:CONDA_PREFIX"
76+
$cfg.CMAKE.EXTRA_ARGS += "-DCMAKE_C_COMPILER_LAUNCHER=ccache"
77+
$cfg.CMAKE.EXTRA_ARGS += "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
5978
$cfg | ConvertTo-Json -Depth 16 | Set-Content scripts/setup/config.ci.json
6079
'
6180
6281
- name: Setup dependencies and build Ignis
6382
shell: bash -el {0}
6483
run: |
6584
export CMAKE_PREFIX_PATH="$CONDA_PREFIX:$CMAKE_PREFIX_PATH"
85+
export CPM_SOURCE_CACHE="$GITHUB_WORKSPACE/.cpm-cache"
6686
pwsh ./scripts/setup/setup.ps1 -config_file scripts/setup/config.ci.json
6787
6888
- name: Run tests

.github/workflows/build-windows.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,19 @@ jobs:
3030
llvmdev=20.1
3131
clangdev=20.1
3232
lld=20.1
33+
zlib
34+
zstd
35+
libxml2-devel
3336
init-shell: powershell
3437
cache-environment: true
3538

39+
- name: Setup sccache
40+
uses: hendrikmuhs/ccache-action@v1.2
41+
with:
42+
variant: sccache
43+
key: ${{ github.job }}-${{ runner.os }}
44+
max-size: 2G
45+
3646
- name: Cache AnyDSL toolchain (thorin/artic/runtime)
3747
uses: actions/cache@v4
3848
with:
@@ -41,6 +51,14 @@ jobs:
4151
restore-keys: |
4252
anydsl-deps-${{ runner.os }}-
4353
54+
- name: Cache CPM sources
55+
uses: actions/cache@v4
56+
with:
57+
path: .cpm-cache
58+
key: cpm-${{ runner.os }}-${{ hashFiles('cmake/Dependencies.cmake') }}
59+
restore-keys: |
60+
cpm-${{ runner.os }}-
61+
4462
- name: Generate CI setup config
4563
shell: pwsh
4664
run: |
@@ -54,12 +72,15 @@ jobs:
5472
# prefix on the search path for every sub-build that re-runs
5573
# find_package(LLVM) via thorin.
5674
$cfg.CMAKE.EXTRA_ARGS += "-DCMAKE_PREFIX_PATH=$env:CONDA_PREFIX/Library"
75+
$cfg.CMAKE.EXTRA_ARGS += "-DCMAKE_C_COMPILER_LAUNCHER=sccache"
76+
$cfg.CMAKE.EXTRA_ARGS += "-DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
5777
$cfg | ConvertTo-Json -Depth 16 | Set-Content scripts/setup/config.ci.json
5878
5979
- name: Setup dependencies and build Ignis
6080
shell: pwsh
6181
run: |
6282
$env:CMAKE_PREFIX_PATH = "$env:CONDA_PREFIX/Library;$env:CMAKE_PREFIX_PATH"
83+
$env:CPM_SOURCE_CACHE = "$env:GITHUB_WORKSPACE/.cpm-cache"
6384
./scripts/setup/setup.ps1 -config_file scripts/setup/config.ci.json
6485
6586
- name: Run tests

0 commit comments

Comments
 (0)