-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy path.appveyor.yml
More file actions
140 lines (114 loc) · 6.17 KB
/
Copy path.appveyor.yml
File metadata and controls
140 lines (114 loc) · 6.17 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
environment:
matrix:
- job_name: win
appveyor_build_worker_image: Visual Studio 2022
- job_name: linux
appveyor_build_worker_image: Ubuntu2004
- job_name: mac
appveyor_build_worker_image: macos-monterey
- job_name: test
appveyor_build_worker_image: Ubuntu2004
matrix:
fast_finish: true
version: build-{build}
configuration: Release
platform: x64
clone_depth: 1
init:
- ps: >-
$env:DATE = $(Get-Date -Format d-MMM-yyyy)
$githash = $env:APPVEYOR_REPO_COMMIT.Substring(0, 7)
$gittag = if ($env:APPVEYOR_REPO_TAG -eq $True) {"_$($env:APPVEYOR_REPO_TAG_NAME)"} else {""}
Update-AppveyorBuild -Version "$($env:DATE)_g${githash}${gittag}"
$env:RELEASE_VERSION = $(Get-Date -Format d-MMMM-yyyy)
for:
-
matrix:
only:
- job_name: win
build_script:
- ps: Invoke-WebRequest -Uri https://github.com/facebook/zstd/archive/refs/tags/v1.5.6.zip -OutFile zstd.zip
- ps: Expand-Archive zstd.zip -DestinationPath .
- cmake -Wno-dev -S zstd-1.5.6\build\cmake -B zstd-build -DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%\zstd-install -DZSTD_BUILD_SHARED=OFF -DZSTD_BUILD_STATIC=ON -DZSTD_BUILD_PROGRAMS=OFF -DZSTD_BUILD_TESTS=OFF -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
- cmake --build zstd-build --config Release --target install
- cmake -Wno-dev -B build -DENABLE_ZSTD=ON -DCMAKE_PREFIX_PATH=%APPVEYOR_BUILD_FOLDER%\zstd-install
- cmake --build build --config %configuration%
- python .github\scripts\release_smoke.py .\build\bin\niimath.exe --expect-zstd
after_build:
- 7z a niimath_win.zip .\build\bin\* >$null
- appveyor PushArtifact niimath_win.zip
-
matrix:
only:
- job_name: linux
build_script:
- export CC=gcc-9 CXX=g++-9
- sudo apt-get update
- sudo apt-get install -y libzstd-dev
- cmake -Wno-dev -B build -DENABLE_ZSTD=ON
- cmake --build build
- python3 .github/scripts/release_smoke.py ./build/bin/niimath --expect-zstd
after_build:
- 7z a niimath_lnx.zip ./build/bin/* &>/dev/null
- appveyor PushArtifact niimath_lnx.zip
-
matrix:
only:
- job_name: mac
build_script:
# Build a universal (x86_64+arm64) STATIC libzstd from source, then replace the
# runner's single-arch homebrew libzstd with it. CMake's zstd detection resolves
# to /usr/local/lib/libzstd (shown in the build log), so we overwrite the lib there
# and remove the dylibs. Both the native x86_64 and cross-compiled arm64 slices then
# link the universal static lib; this also drops the runtime libzstd.dylib
# dependency, making the released binary self-contained. (Done this way rather than
# via PKG_CONFIG_PATH, which the SuperBuild's nested configure does not honor.)
- curl -sL -o zstd.tar.gz https://github.com/facebook/zstd/releases/download/v1.5.6/zstd-1.5.6.tar.gz
- tar xzf zstd.tar.gz
- make -C zstd-1.5.6/lib -j libzstd.a CFLAGS="-O3 -fPIC -arch x86_64 -arch arm64"
- sudo find /usr/local -name 'libzstd*.dylib' -delete
- sudo cp zstd-1.5.6/lib/libzstd.a /usr/local/lib/libzstd.a
- sudo cp zstd-1.5.6/lib/zstd.h /usr/local/include/zstd.h
- cmake -Wno-dev -DCMAKE_OSX_ARCHITECTURES=x86_64 -DOPENMP_XCODE=OFF -B build/x86_64
- cmake --build build/x86_64
- cmake -Wno-dev -DCMAKE_OSX_ARCHITECTURES=arm64 -DOPENMP_XCODE=OFF -B build/arm64
- cmake --build build/arm64
after_build:
- lipo -create -output build/niimath build/x86_64/bin/niimath build/arm64/bin/niimath
- lipo -info build/niimath # expect: x86_64 arm64
- otool -L build/niimath | grep -i zstd || echo "zstd statically linked (no dylib dependency)"
- python3 .github/scripts/release_smoke.py ./build/niimath --expect-zstd
- zip -j niimath_macos.zip ./build/niimath &>/dev/null
- appveyor PushArtifact niimath_macos.zip
-
matrix:
only:
- job_name: test
build_script:
- export CC=gcc-9 CXX=g++-9
- sudo apt-get update
- sudo apt-get install -y libzstd-dev
- cmake -Wno-dev -B build -DENABLE_ZSTD=ON
- cmake --build build
- python3 .github/scripts/release_smoke.py ./build/bin/niimath --expect-zstd
# QWARP=1 compile gate: the object-based (ALOBJS) and direct-source (ALSRC) Makefile
# inventories must BOTH link the -qwarp dispatch (guards the qwarp source-list drift that
# the default builds never exercise). native-noomp is the direct-source (ALSRC) path.
- make -C src QWARP=1 CNAME=gcc-9
- make -C src QWARP=1 CNAME=gcc-9 native-noomp
# QWARP=1 dispatch smoke (not just linkage): a 4D subject reaches nifti_qwarp_wrap and hits its
# single-3D-volume guard (before any base read or optimization), emitting the reject and exiting
# nonzero — proving -qwarp is dispatched, not reported as an "unknown operation". No warp runs.
- python3 -c "import sys; sys.path.insert(0,'.github/scripts'); from release_smoke import write_float32_nifti; from pathlib import Path; write_float32_nifti(Path('/tmp/qw4d.nii'),(4,4,4),[1.0]*128,nt=2); write_float32_nifti(Path('/tmp/qwb.nii'),(4,4,4),[1.0]*64)"
- if src/niimath /tmp/qw4d.nii -qwarp /tmp/qwb.nii /tmp/qwout.nii 2>/tmp/qw.err; then echo "ERROR -qwarp 4D subject should fail"; exit 1; fi
- grep -q "single 3D volume" /tmp/qw.err || { echo "ERROR -qwarp not dispatched"; cat /tmp/qw.err; exit 1; }
after_build:
- export builddir=$APPVEYOR_BUILD_FOLDER/build
- export exe=$builddir/bin/niimath tstexe=$builddir/bin/niimath basedir=$builddir/niimath_tests
- git clone https://github.com/rordenlab/niimath_tests.git $basedir
- cd $basedir; ./canonical_test.sh
# NOTE: GitHub Release ASSETS (the niimath_{win,lnx,macos}.zip binaries) are published by the
# GitHub Actions workflow `.github/workflows/release-binaries.yml` using the built-in GITHUB_TOKEN.
# The old AppVeyor `deploy: provider: GitHub` step was removed because its personal-access token
# silently expired and returned 401 at release time — failing the tag build (red master) and
# blocking assets. AppVeyor now only builds/tests cross-platform; it no longer deploys.