-
Notifications
You must be signed in to change notification settings - Fork 205
198 lines (174 loc) · 5.55 KB
/
vm2-ci.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: vm2-ci
on:
- push
- pull_request
jobs:
vm2-ci:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- name: freebsd
version: "14.0"
- name: omnios
version: "r151046"
- name: solaris
version: "11.4"
compiler:
- clang
- gcc
strictness:
- "normal"
- "strict"
exclude:
- os: {name: omnios}
compiler: clang
# vmactions/solaris-vm works but is very slow to install gcc. Disable it for now
- os: {name: solaris}
- os: {name: solaris}
compiler: clang
steps:
- name: Configure environment
run: |
echo "Nothing to do for ${{ matrix.os.name }}"
- name: Install packages
run: |
echo "The actual install takes place in the VM in the build step"
tee ~/work/install_freebsd_deps.sh <<EOF
#!/bin/sh
pkg install -y \
bison ccache gmake \
$(case ${{matrix.compiler }} in
(gcc) echo ${{matrix.compiler}} ;; esac) \
libslang2 \
cairo \
libgd \
mariadb-connector-c \
postgresql16-client \
qt5-buildtools qt5-gui
EOF
# Dependencies for disabled contribs:
# freeimage \
tee ~/work/install_omnios_deps.sh <<EOF
#!/usr/xpg4/bin/sh
set -ex
pkg install \
build-essential \
ccache
pkg list
EOF
tee ~/work/install_solaris_deps.sh <<EOF
#!/usr/xpg4/bin/sh
set -ex
pkgadd -n -d http://get.opencsw.org/now CSWpkgutil || true # already installed by action
/opt/csw/bin/pkgutil -U
/opt/csw/bin/pkgutil -y -i \
ccache \
gcc5core \
gmake \
libcurl_dev \
libssl_dev
/opt/csw/bin/pkgutil -l
EOF
chmod a+x ~/work/install_*_deps.sh
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.branch }}
- run: pwd
- run: ls
- name: Prepare ccache using action
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os.name }}-${{ matrix.os.version }}-${{ matrix.compiler }}-${{ matrix.strictness }}-ci
max-size: "32M"
- name: Configure build shell
run: |
set -ex
case ${{matrix.os.name }} in
*bsd) _cpus="sysctl -n hw.ncpu" ;;
omnios|solaris) _cpus="psrinfo -p" _add_path="/usr/sfw/bin" ;;
esac
HB_USER_CFLAGS=""
HB_USER_LDFLAGS=""
case ${{matrix.strictness}} in
normal) ;;
strict) case ${{matrix.compiler}} in
(gcc) HB_USER_CFLAGS="$HB_USER_CFLAGS -Werror -Wno-error=deprecated-declarations -Wno-error=array-bounds" ;;
(*) HB_USER_CFLAGS="$HB_USER_CFLAGS -Werror" ;;
esac ;;
esac
tee ./.bashrc <<EOENV
# These contribs do not build on any platform
export HB_BUILD_CONTRIBS="no hbfimage" # incompatible with freeimage 3.18+
export HB_BUILD_VERBOSE="yes"
export HBMK_WITH_SQLITE3="local"
export HB_USER_CFLAGS="$HB_USER_CFLAGS"
export HB_USER_LDFLAGS="$HB_USER_LDFLAGS"
export HB_CCACHE=ccache
export PATH="$_add_path:\$PATH"
export N_CPUS="\$($_cpus)"
EOENV
- name: Generate build script
run: |
tee ~/work/run_build.sh <<'EOF'
set -ex
echo "::group::Configure ccache in VM"
ccache --set-config="cache_dir=$(pwd)/.ccache"
ccache --set-config=max_size=32M
ccache --set-config=compression=true
ccache -p
echo ::group::Build Harbour
set -ex
. ./.bashrc
gmake -j$N_CPUS \
HB_BUILD_CONTRIBS=no \
HB_COMPILER=${{matrix.compiler}}
echo "::group::Build contribs"
set -ex
. ./.bashrc
gmake -j$N_CPUS \
-C contrib \
HB_COMPILER=${{matrix.compiler}}
echo "::group::Run tests"
set -ex
bin/*/${{matrix.compiler}}/hbtest
EOF
- name: Build Harbour and contribs (FreeBSD VM)
if: matrix.os.name == 'freebsd'
uses: vmactions/freebsd-vm@v1
with:
usesh: true
mem: 2048
release: "${{ matrix.os.version }}"
prepare: |
echo "::group::Install dependencies"
set -ex
~/work/install_${{ matrix.os.name }}_deps.sh
run: |
. ~/work/run_build.sh
- name: Build Harbour and contribs (OmniOS VM)
if: matrix.os.name == 'omnios'
uses: vmactions/omnios-vm@v1
with:
usesh: true
mem: 2048
prepare: |
echo "::group::Install dependencies"
set -ex
~/work/install_${{ matrix.os.name }}_deps.sh
run: |
. ~/work/run_build.sh
- name: Build Harbour and contribs (Solaris VM)
if: matrix.os.name == 'solaris'
uses: vmactions/solaris-vm@v1
with:
usesh: true
mem: 4096
prepare: |
echo "::group::Install dependencies"
set -ex
~/work/install_${{ matrix.os.name }}_deps.sh
run: |
. ~/work/run_build.sh