-
Notifications
You must be signed in to change notification settings - Fork 206
183 lines (162 loc) · 5.47 KB
/
windows-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
name: windows-ci
on:
- push
- pull_request
jobs:
windows-ci:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
compiler:
- bcc
- mingw64
- clang
cpu:
- x86
- x86_64
exclude:
- compiler: bcc
cpu: x86_64
- compiler: clang
cpu: x86
strictness:
- "normal"
- "strict"
steps:
- name: Configure environment
shell: bash
run: |
set -ex
{
case ${{matrix.cpu}} in
(x86) echo MINGWxx="MINGW32"
echo "msys_cpu=i686" ;;
(x86_64) echo MINGWxx="MINGW64"
echo "msys_cpu=${{matrix.cpu}}" ;;
esac
case ${{matrix.compiler}} in
(clang) echo MINGWxx="CLANG64" ;;
esac
} >> $GITHUB_ENV
- name: Install packages
uses: msys2/setup-msys2@v2
with:
msystem: ${{ env.MINGWxx }}
location: d:/
update: true
install: >
mingw-w64-${{ env.msys_cpu }}-ccache
mingw-w64-${{ env.msys_cpu }}-gcc
mingw-w64-${{ env.msys_cpu }}-make
mingw-w64-${{ env.msys_cpu }}-allegro
mingw-w64-${{ env.msys_cpu }}-bzip2
mingw-w64-${{ env.msys_cpu }}-cairo
mingw-w64-${{ env.msys_cpu }}-curl
mingw-w64-${{ env.msys_cpu }}-libgd
mingw-w64-${{ env.msys_cpu }}-ghostscript
mingw-w64-${{ env.msys_cpu }}-openssl
mingw-w64-${{ env.msys_cpu }}-qt5-base
# Dependencies for disabled contribs:
# mingw-w64-${{ env.msys_cpu }}-freeimage
- name: 'Add packages available on 64-bit hosts only'
if: matrix.cpu != 'x86'
shell: msys2 {0}
run: |
pacman -S --noconfirm mingw-w64-${{ env.msys_cpu }}-postgresql
pacman -S --noconfirm mingw-w64-${{ env.msys_cpu }}-libmariadbclient
pacman -S --noconfirm mingw-w64-${{ env.msys_cpu }}-firebird
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.branch }}
- run: pwd
shell: msys2 {0}
- run: ls
shell: msys2 {0}
- name: Prepare ccache using action
if: matrix.compiler != 'bcc'
uses: hendrikmuhs/[email protected]
with:
key: windows-${{ matrix.cpu }}-${{ matrix.compiler }}-${{ matrix.strictness }}-ci
max-size: "32M"
- name: Configure build shell
shell: msys2 {0}
run: |
set -ex
HB_USER_CFLAGS=""
HB_USER_LDFLAGS=""
case ${{matrix.compiler}} in
(clang)
pacman -S --noconfirm mingw-w64-${{ env.msys_cpu }}-clang
PATH="$PATH:/mingw64/bin/"
tee ./.bashrc <<EOMCLPTH
export PATH="\$PATH:/mingw64/bin/" # add ccache location
EOMCLPTH
;;
esac
case ${{matrix.strictness}} in
normal) ;;
strict) case ${{matrix.compiler}} in
(mingw64) HB_USER_CFLAGS="$HB_USER_CFLAGS -Werror -Wno-error=deprecated-declarations -Wno-error=array-bounds" ;;
(bcc) HB_USER_CFLAGS="$HB_USER_CFLAGS -w!" ;;
(*) HB_USER_CFLAGS="$HB_USER_CFLAGS -Werror -Wno-error=deprecated-declarations" ;;
esac ;;
esac
tee -a ./.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=$(which ccache.exe)
export mingwxx="$(echo "$MINGWxx" | tr A-Z a-z)"
EOENV
case ${{matrix.compiler}} in
bcc)
curl -LO "http://altd.embarcadero.com/download/bcppbuilder/freecommandLinetools.exe"
./freecommandLinetools.exe -s -verbose
find /c/Borland -type d || exit 1
tee -a ./.bashrc <<EOMSYSENV
export PATH="/c/Borland/BCC55/Bin:\$PATH"
export HB_WITH_CURL="/d/msys64/$mingwxx/include"
export HB_CCACHE=""
EOMSYSENV
;;
*)
tee -a ./.bashrc <<'EOCCACHE'
# Reconfigure ccache in msys2
ccache --set-config="cache_dir=$(pwd)/.ccache"
ccache --set-config=max_size=32M
ccache --set-config=compression=true
ccache -p
EOCCACHE
;;
esac
- name: Build Harbour
shell: msys2 {0}
run: |
echo ::group::Build Harbour
set -ex
source ./.bashrc
mingw32-make.exe -j2 \
HB_CPU=${{matrix.cpu}} \
HB_BUILD_CONTRIBS=no \
HB_COMPILER=${{matrix.compiler}}
- name: Build contribs
shell: msys2 {0}
run: |
echo ::group::Build contribs
set -ex
source ./.bashrc
mingw32-make.exe -j2 \
-C contrib \
HB_CPU=${{matrix.cpu}} \
HB_COMPILER=${{matrix.compiler}}
- name: Run tests
shell: msys2 {0}
run: |
echo ::group::Run tests
set -ex
bin/win/${{matrix.compiler}}/hbtest.exe