forked from networkupstools/nut
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
157 lines (135 loc) · 6.74 KB
/
appveyor.yml
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#
# Network UPS Tools: AppVeyor CI build recipe: NUT for Windows with MSYS2/MinGW x64
#
# https://www.msys2.org/docs/ci/
# https://www.appveyor.com/docs/appveyor-yml/
# https://www.appveyor.com/docs/build-configuration/
# https://www.appveyor.com/docs/windows-images-software/
version: 2.8.1.{build}-{branch}
# base image
image: Visual Studio 2022
# branches to build
branches:
# whitelist
only:
- master
- /Windows/
platform: x64
# https://www.appveyor.com/docs/build-cache/
environment:
APPVEYOR_SAVE_CACHE_ON_ERROR: true
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=9
CCACHE_DIR: /home/appveyor/.ccache
# https://github.com/networkupstools/nut/blob/Windows-v2.8.0-1/docs/config-prereqs.txt#L951
# or look for the chapter in nearby lines in later (current) revisions.
# Note: not using `time` in scripts currently - they did upset
# AppVeyor console log scanner with a /^sys.*/ match (apparently)
install:
- cmd: |
REM Do not give pacman cause for complaints:
C:\msys64\usr\bin\bash -lc "mkdir -p /var/cache/pacman/pkg; ls -la /"
- cmd: |
REM Core update (in case any core packages are outdated):
C:\msys64\usr\bin\bash -lc "date -u; pacman --noconfirm -Syuu"
- cmd: |
REM Normal update (same command again):
C:\msys64\usr\bin\bash -lc "date -u; pacman --noconfirm -Syuu"
- cmd: |
REM Prerequisites for NUT per https://github.com/networkupstools/nut/blob/master/docs/config-prereqs.txt :
C:\msys64\usr\bin\bash -lc "date -u; pacman --noconfirm -S --needed base-devel mingw-w64-x86_64-toolchain autoconf-wrapper automake-wrapper libtool mingw-w64-x86_64-libltdl gcc ccache mingw-w64-x86_64-ccache git aspell aspell-en python mingw-w64-x86_64-python-pygments mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libusb mingw-w64-x86_64-libusb-compat-git mingw-w64-x86_64-neon libneon-devel mingw-w64-x86_64-libmodbus-git mingw-w64-x86_64-libgd mingw-w64-x86_64-cppunit"
- cmd: |
REM Assorted stats after package processing:
C:\msys64\usr\bin\bash -lc "date -u; ls -la / ; du -ksx / ; date -u; du -ks /var/cache/pacman/pkg; date -u"
REM Preserve the current working directory:
set CHERE_INVOKING=yes
REM Start a 64 bit Mingw environment:
set MSYSTEM=MINGW64
C:\msys64\usr\bin\bash -lc 'PATH="/mingw64/bin:$PATH" ; export PATH ; pwd ; ccache -sv || echo "SKIP: Could not query ccache stats" ; ccache -o sloppiness=file_macro || true ; ccache -o compression=true || true '
before_build:
- cmd: |
REM Ensure we have a net-snmp to build against
REM Adapted from scripts/Windows/README.adoc document.
REM Here we hope to build it once, then use the
REM stashed version across Appveyor rebuilds.
REM Preserve the current working directory:
set CHERE_INVOKING=yes
REM Start a 64 bit Mingw environment:
set MSYSTEM=MINGW64
C:\msys64\usr\bin\bash -lc "date -u; export MSYS2_PATH ; bash ./scripts/Windows/build-mingw-prereqs.sh"
build_script:
- cmd: |
REM Preserve the current working directory:
set CHERE_INVOKING=yes
REM Start a 64 bit Mingw environment:
set MSYSTEM=MINGW64
C:\msys64\usr\bin\bash -lc 'date -u; PATH="/mingw64/bin:$PATH" CI_SKIP_CHECK=true ./ci_build.sh'
after_build:
- cmd: |
REM Preserve the current working directory:
set CHERE_INVOKING=yes
REM Start a 64 bit Mingw environment:
set MSYSTEM=MINGW64
C:\msys64\usr\bin\bash -lc 'date -u; PATH="/mingw64/bin:$PATH" ; export PATH ; ccache -sv || ccache -s || echo "SKIP: Could not query ccache stats"'
test_script:
- cmd: |
REM Preserve the current working directory:
set CHERE_INVOKING=yes
REM Start a 64 bit Mingw environment:
set MSYSTEM=MINGW64
REM Start Mingw-based integration and unit checks:
C:\msys64\usr\bin\bash -lc 'date -u; PATH="/mingw64/bin:$PATH" make -s check'
REM Start a Mingw-based documentation spellcheck:
C:\msys64\usr\bin\bash -lc 'date -u; PATH="/mingw64/bin:$PATH" make -s -j 4 spellcheck'
after_test:
- cmd: |
REM Preserve the current working directory:
set CHERE_INVOKING=yes
REM Start a 64 bit Mingw environment:
set MSYSTEM=MINGW64
REM Oh the joys of shell scripting with strings passed through CMD:
REM Note: currently Python installation path with MSYS is buggy [#1584]
C:\msys64\usr\bin\bash -lc 'date -u; if ! rm -rf ".inst" ; then echo "WARNING: Failed to clean away .inst" ; fi ; PATH="/mingw64/bin:$PATH" make -s install-win-bundle DESTDIR="`pwd`/.inst/NUT-for-Windows-x86_64-SNAPSHOT-%APPVEYOR_BUILD_VERSION%" ; ln -fs "NUT-for-Windows-x86_64-SNAPSHOT-%APPVEYOR_BUILD_VERSION%" ./.inst/NUT-for-Windows-x86_64-SNAPSHOT ; ( cd .inst/NUT-for-Windows-x86_64-SNAPSHOT ; find . -ls ; )'
cd .inst
7z a ../NUT-for-Windows-x86_64-SNAPSHOT-%APPVEYOR_BUILD_VERSION%.7z NUT*
- cmd: |
REM Preserve the current working directory:
set CHERE_INVOKING=yes
REM Start a 64 bit Mingw environment:
set MSYSTEM=MINGW64
C:\msys64\usr\bin\bash -lc 'date -u; PATH="/mingw64/bin:$PATH" ; export PATH ; ccache -sv || ccache -s || echo "SKIP: Could not query ccache stats"'
C:\msys64\usr\bin\bash -lc 'date -u; PATH="/mingw64/bin:$PATH" ; export PATH ; ccache -x || echo "SKIP: Could not query ccache compression stats"'
artifacts:
- path: 'NUT-for-Windows*.7z'
name: Bundle of binary files and FOSS dependencies of NUT for Windows
- path: config.log
name: config.log of recent build of NUT for Windows
- path: config.nut_report_feature.log
name: config.nut_report_feature.log of recent build of NUT for Windows
# Example optional cache (depends on file change):
# - C:\msys64 -> appveyor.yml
cache:
- C:\msys64\home\appveyor\.ccache
- C:\msys64\home\appveyor\ccache # likely missing, no problem - but the name is reported in ccache status
- C:\Users\appveyor\AppData\Local\ccache # may be default in newer versions
- C:\Users\appveyor\AppData\Local\.ccache # may be missing, but for completeness like above
- C:\msys64\var\cache\pacman\pkg
- C:\msys64\home\appveyor\nut-win-deps
# Below we tried to stash binaries of MSYS2 environment
# so VM deployment is faster on subsequent builds
# (update/install "from scratch" costs about 3 min),
# but unstashing the archive takes comparable time
# and often leads to conflicts in pacman book-keeping,
# while creating/updating the archive costs ~10 min.
#- C:\msys64\var\lib\pacman
#- C:\msys64\var\lib
#- C:\msys64\mingw64
#- C:\msys64\mingw32
#- C:\msys64\ucrt64
#- C:\msys64\clang32
#- C:\msys64\clang64
#- C:\msys64\clangarm64
#- C:\msys64\usr
#- C:\msys64\bin
#- C:\msys64\etc
#- C:\msys64\*.*
#- C:\msys64\installerResources