-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (79 loc) · 3.2 KB
/
Copy pathguix-shell.yml
File metadata and controls
95 lines (79 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Guix Shell
# Build mvox from source inside a Guix development environment.
#
# Runs "guix shell -D mvox" to provide all build dependencies
# (MFEM, ITK, cmake, etc.), then builds with cmake and make.
# This is how a developer would build mvox locally.
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
schedule:
- cron: '0 0 * * 1'
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-latest]
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-guix
- name: Lint packages
continue-on-error: true
run: guix lint -L . mfem mfem@4.5 mvox mvox-mfem-4.5
- name: Clone mvox
uses: actions/checkout@v5
with:
repository: benzwick/mvox
path: mvox-src
# Each build step runs inside "guix shell --pure -D" so that all
# search paths (CMAKE_PREFIX_PATH, LIBRARY_PATH, etc.) are set
# correctly and system paths don't interfere. The store is populated
# on the first invocation; subsequent calls reuse the cached profile
# and are fast.
# CMAKE_INSTALL_RPATH_USE_LINK_PATH preserves Guix store library
# paths in installed binaries. Without this, cmake strips rpath on
# install and the binary cannot find shared libraries. Guix's own
# cmake-build-system handles this via its fix-runpath phase, but
# that phase is not available when building manually in guix shell.
# Build the shell profile (MFEM, ITK, cmake, etc.) in a separate
# step so that dependency build failures are not conflated with
# cmake configuration errors.
- name: Build shell environment
run: guix shell --pure -L . -D mvox -- true
- name: Configure mvox
run: guix shell --pure -L . -D mvox -- cmake -B build -S mvox-src -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON
- name: Build mvox
run: guix shell --pure -L . -D mvox -- make -C build -j$(nproc)
- name: Install mvox
run: guix shell --pure -L . -D mvox -- cmake --install build --prefix install
- name: Smoke test (installed)
run: guix shell --pure -L . -D mvox -- bash -c './install/bin/mvox --help || test $? -eq 1'
# The example scripts use wget and expect mvox on PATH.
# Add wget to the shell and prepend the local install prefix.
- name: Test boxmesh
run: guix shell --pure -L . -D mvox wget -- bash -c 'export PATH=$PWD/install/bin:$PATH && cd mvox-src/examples && bash boxmesh.sh'
- name: Test brain-tensors
run: guix shell --pure -L . -D mvox wget -- bash -c 'export PATH=$PWD/install/bin:$PATH && cd mvox-src/examples && bash brain-tensors.sh'
- name: Collect Guix build logs
if: always()
run: |
mkdir -p guix-build-logs
for f in /var/log/guix/drvs/*/*; do
sudo cp "$f" guix-build-logs/ || true
done
gunzip guix-build-logs/*.gz 2>/dev/null || true
- name: Upload Guix build logs
if: always()
uses: actions/upload-artifact@v6
with:
name: guix-build-logs-${{ matrix.os }}
path: guix-build-logs/
- name: Stop Guix daemon
if: always()
run: sudo pkill guix-daemon || true