Skip to content

ci: use the conda zlib on Windows instead of the from-source build #276

ci: use the conda zlib on Windows instead of the from-source build

ci: use the conda zlib on Windows instead of the from-source build #276

Workflow file for this run

name: Build Windows
on:
push:
branches: [ master, development ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: windows-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v7
# A complete, self-consistent LLVM + Clang dev toolchain (static libs and
# cmake config), which the distribution installers do not provide.
- name: Setup LLVM/Clang toolchain
uses: mamba-org/setup-micromamba@v2
with:
environment-name: llvm
create-args: >-
llvmdev=20.1
clangdev=20.1
lld=20.1
zlib
zstd
libxml2-devel
init-shell: powershell
cache-environment: true
- name: Setup sccache
uses: hendrikmuhs/ccache-action@v1.2
with:
variant: sccache
key: ${{ github.job }}-${{ runner.os }}
max-size: 2G
- name: Cache AnyDSL toolchain (thorin/artic/runtime)
uses: actions/cache@v4
with:
path: deps
key: anydsl-deps-${{ runner.os }}-${{ hashFiles('scripts/setup/config.json', 'scripts/setup/*.ps1') }}
restore-keys: |
anydsl-deps-${{ runner.os }}-
- name: Cache CPM sources
uses: actions/cache@v4
with:
path: .cpm-cache
key: cpm-${{ runner.os }}-${{ hashFiles('cmake/Dependencies.cmake') }}
restore-keys: |
cpm-${{ runner.os }}-
- name: Generate CI setup config
shell: pwsh
run: |
$cfg = Get-Content scripts/setup/config.json -Raw | ConvertFrom-Json
# Keep the dependency tree inside the workspace so it can be cached.
$cfg.LOCATION = "$env:GITHUB_WORKSPACE/deps"
# conda places packages under <prefix>/Library on Windows.
$cfg.LLVM.SYSTEM_DIR = "$env:CONDA_PREFIX/Library"
# conda's LLVM exports transitive imported targets (ZLIB::ZLIB, zstd,
# LibXml2). Unlike Linux there are no system copies, so put the conda
# prefix on the search path for every sub-build that re-runs
# find_package(LLVM) via thorin.
$cfg.CMAKE.EXTRA_ARGS += "-DCMAKE_PREFIX_PATH=$env:CONDA_PREFIX/Library"
$cfg.CMAKE.EXTRA_ARGS += "-DCMAKE_C_COMPILER_LAUNCHER=sccache"
$cfg.CMAKE.EXTRA_ARGS += "-DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
# zlib ships in the conda toolchain env (see create-args), so skip the
# flaky from-source build; Ignis resolves it via CMAKE_PREFIX_PATH.
$cfg.ZLIB.ENABLED = $false
$cfg | ConvertTo-Json -Depth 16 | Set-Content scripts/setup/config.ci.json
- name: Setup dependencies and build Ignis
shell: pwsh
run: |
$env:CMAKE_PREFIX_PATH = "$env:CONDA_PREFIX/Library;$env:CMAKE_PREFIX_PATH"
$env:CPM_SOURCE_CACHE = "$env:GITHUB_WORKSPACE/.cpm-cache"
./scripts/setup/setup.ps1 -config_file scripts/setup/config.ci.json
- name: Run tests
shell: pwsh
run: ctest --test-dir build/Release --output-on-failure -E "(ignis_test_integrator)|(ignis_test_multiple_runtimes)"