-
Notifications
You must be signed in to change notification settings - Fork 136
489 lines (457 loc) · 15.3 KB
/
build.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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
#
# build.yml - GitHub build action for AVRDUDE
# Copyright (C) 2021 Marius Greuel
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
name: Build
on:
push:
branches-ignore:
- 'onlinedocs'
pull_request:
branches-ignore:
- 'onlinedocs'
workflow_call:
env:
BUILD_TYPE: RelWithDebInfo
jobs:
linux-x86_64-autotools:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install prerequisites
run: >-
sudo apt-get update
sudo apt-get install -y
build-essential
automake
libtool
flex
bison
libelf-dev
libusb-dev
libusb-1.0-0-dev
libhidapi-dev
libftdi1-dev
libreadline-dev
libserialport-dev
libgpiod-dev
texinfo
texlive
texi2html
- name: Configure
run: >-
autoreconf -vis src
mkdir _ambuild && cd _ambuild
../src/configure
--enable-shared
--enable-doc
--enable-parport
--enable-linuxgpio
--enable-linuxspi
- name: Build
run: make -C _ambuild -j$(nproc)
- name: "Dryrun test (not installed)"
run: printf "\n\n" | ./tools/test-avrdude -v -e _ambuild/avrdude -c '-C _ambuild/avrdude.conf' -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28"
- name: Install
run: sudo make -C _ambuild install
- name: Debug Information
run: >-
find /usr/local -not -type d -ipath '*avrdude*'
ldd /usr/local/bin/avrdude
ldconfig -N -X -v
- name: "Dryrun test (installed)"
run: >-
export LD_LIBRARY_PATH=/usr/local/lib
printf "\n\n" | ./tools/test-avrdude -v -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28"
# Re-enable distcheck after the doc fixes
# - name: distcheck
# run: make -C _ambuild -j$(nproc) distcheck "DISTCHECK_CONFIGURE_FLAGS=--disable-doc"
linux-x86_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install prerequisites
run: >-
sudo apt-get update
sudo apt-get install -y
build-essential
cmake
flex
bison
libelf-dev
libusb-dev
libusb-1.0-0-dev
libhidapi-dev
libftdi1-dev
libreadline-dev
libserialport-dev
libgpiod-dev
texinfo
texlive
texi2html
- name: Configure
run: >-
cmake
-D BUILD_DOC=1
-D DEBUG_CMAKE=1
-D HAVE_LINUXGPIO=1
-D HAVE_LINUXSPI=1
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-B build
- name: Build
run: cmake --build build
- name: "Dryrun test (not installed)"
run: printf "\n\n" | ./tools/test-avrdude -v -e build/src/avrdude -c '-C build/src/avrdude.conf' -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28"
- name: Install
run: sudo cmake --build build --target install
- name: "Dryrun test (installed)"
run: printf "\n\n" | ./tools/test-avrdude -v -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28"
- name: Archive build artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: build-linux-x86_64
path: |
build/
!**/*.d
!**/*.o
- name: Archive executables
uses: actions/upload-artifact@v3
with:
name: avrdude-linux-x86_64
path: |
build/src/avrdude
build/src/avrdude.conf
linux:
runs-on: ubuntu-latest
container: debian:11
strategy:
matrix:
include:
- { arch: i386, processor: i686, prefix: i686-linux-gnu, inc-lib: i386-linux-gnu }
- { arch: armhf, processor: armhf, prefix: arm-linux-gnueabihf, inc-lib: arm-linux-gnueabihf }
- { arch: arm64, processor: aarch64, prefix: aarch64-linux-gnu, inc-lib: aarch64-linux-gnu }
steps:
- uses: actions/checkout@v3
- name: Add architecture
run: |
dpkg --add-architecture ${{matrix.arch}}
apt-get update
- name: Install prerequisites
run: >-
apt-get update
apt-get install -y
git
cmake
flex
bison
crossbuild-essential-${{matrix.arch}}
libelf-dev:${{matrix.arch}}
libusb-dev:${{matrix.arch}}
libusb-1.0-0-dev:${{matrix.arch}}
libhidapi-dev:${{matrix.arch}}
libftdi1-dev:${{matrix.arch}}
libreadline-dev:${{matrix.arch}}
libserialport-dev:${{matrix.arch}}
libgpiod-dev:${{matrix.arch}}
- name: Configure
run: >-
cmake
-D DEBUG_CMAKE=1
-D HAVE_LINUXGPIO=1
-D HAVE_LINUXSPI=1
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-D CMAKE_SYSTEM_NAME=Linux
-D CMAKE_SYSTEM_PROCESSOR=${{matrix.processor}}
-D CMAKE_C_COMPILER=${{matrix.prefix}}-gcc
-D CMAKE_FIND_ROOT_PATH=/usr/${{matrix.prefix}}
-D CMAKE_INCLUDE_PATH=/usr/include/${{matrix.inc-lib}}
-D CMAKE_LIBRARY_PATH=/usr/lib/${{matrix.inc-lib}}
-B build
- name: Build
run: cmake --build build
- name: Archive build artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: build-linux-${{matrix.processor}}
path: |
build/
!**/*.d
!**/*.o
- name: Archive executables
uses: actions/upload-artifact@v3
with:
name: avrdude-linux-${{matrix.processor}}
path: |
build/src/avrdude
build/src/avrdude.conf
macos-x86_64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install prerequisites
run: >-
# brew update
brew install
cmake
flex
bison
libelf
libusb
libusb-compat
hidapi
libftdi
readline
libserialport
pkg-config
- name: Configure
run: >-
cmake
-D CMAKE_INSTALL_PREFIX:PATH=$PWD/_prefix
-D CMAKE_C_FLAGS=-I/opt/homebrew/include
-D CMAKE_EXE_LINKER_FLAGS=-L/opt/homebrew/Cellar
-D DEBUG_CMAKE=1
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-B build
- name: Build
run: cmake --build build
- name: "Dryrun test (not installed)"
run: printf "\n\n" | ./tools/test-avrdude -v -e build/src/avrdude -c '-C build/src/avrdude.conf' -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28"
- name: Install
run: cmake --build build --target install
- name: "Dryrun test (installed)"
run: |
export PATH="$PWD/_prefix/bin:$PATH"
: export DYLD_LIBRARY_PATH="$PWD/_prefix/lib${DYLD_LIBRARY_PATH+":$DYLD_LIBRARY_PATH"}"
printf "\n\n" | ./tools/test-avrdude -v -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28"
- name: Archive build artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: build-macos-x86_64
path: |
build/
!**/*.d
!**/*.o
- name: Archive executables
uses: actions/upload-artifact@v3
with:
name: avrdude-macos-x86_64
path: |
build/src/avrdude
build/src/avrdude.conf
macos-x86_64-autotools:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install prerequisites
run: >-
# brew update
brew install
automake
autoconf
libtool
gettext
flex
bison
libelf
libusb
hidapi
libftdi
readline
libserialport
pkg-config
- name: Configure
run: >-
autoreconf -vis src
mkdir _ambuild && cd _ambuild
env
CFLAGS="-I/opt/homebrew/include"
LDFLAGS="-L/opt/homebrew/lib"
../src/configure
--prefix=$PWD/_prefix
- name: Build
run: make -C _ambuild -j$(nproc)
- name: "Dryrun test (not installed)"
run: printf "\n\n" | ./tools/test-avrdude -v -e _ambuild/avrdude -c '-C _ambuild/avrdude.conf' -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28"
- name: Debug Information
run: |
(set -ex; for pkg in libelf libusb hidapi libftdi readline libserialport; do
brew list "$pkg"
done)
ls -l /opt/homebrew/Cellar
ls -l /opt/homebrew/bin
ls -l /opt/homebrew/include
ls -l /opt/homebrew/lib
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
(set -ex; for pkg in libelf libusb-1.0 hidapi libftdi1 readline libserialport; do
if test "x$pkg" = xreadline; then continue; fi
pkg-config --cflags "$pkg"
pkg-config --libs "$pkg"
done)
- name: Install
run: make -C _ambuild install
- name: "Dryrun test (installed)"
run: >-
export PATH="$PWD/_prefix/bin:$PATH"
: export DYLD_LIBRARY_PATH="$PWD/_prefix/lib${DYLD_LIBRARY_PATH+":$DYLD_LIBRARY_PATH"}"
printf "\n\n" | ./tools/test-avrdude -v -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28"
msvc:
runs-on: windows-latest
strategy:
matrix:
include:
- { arch: x86, platform: Win32 }
- { arch: x64, platform: x64 }
# - { arch: arm64, platform: ARM64 }
steps:
- uses: actions/checkout@v3
- name: Install prerequisites
# As Chocolatey is notoriously unreliable, install winflexbison3 directly from GitHub.
# run: choco install winflexbison3
run: |
curl https://github.com/lexxmark/winflexbison/releases/download/v2.5.24/win_flex_bison-2.5.24.zip --location --output winflexbison.zip
unzip winflexbison.zip -d ${{github.workspace}}\winflexbison
echo "${{github.workspace}}\winflexbison" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Configure
run: >-
cmake
-A ${{matrix.platform}}
-D DEBUG_CMAKE=1
-D CMAKE_SYSTEM_VERSION=11
-D CMAKE_C_FLAGS_RELWITHDEBINFO="/MT /GL /Zi /O2 /Ob1 /DNDEBUG"
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MT /GL /Zi /O2 /Ob1 /DNDEBUG"
-D CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO="/DEBUG /INCREMENTAL:NO /LTCG /OPT:REF /OPT:ICF"
-D HAVE_LIBREADLINE=HAVE_LIBREADLINE-NOTFOUND
-D USE_EXTERNAL_LIBS=1
-B build
- name: Build
run: cmake --build build --config ${{env.BUILD_TYPE}}
- name: Debug output build
run: Get-ChildItem -Path build -Force –Recurse
- name: Debug output TEMP
run: |
Write-Host '$env:TEMP'
Write-Host $env:TEMP
Write-Host "env:TEMP=$env:TEMP"
Get-ChildItem -Path $env:TEMP
- name: Debug powershell temp dir
run: |
Write-Host "GetTempPath"
$tmp = [System.IO.Path]::GetTempPath()
Write-Host $tmp
Write-Host "tmp=$tmp"
- name: "Dryrun test (not installed)"
run: |
Write-Host "GetTempPath"
$tmp = [System.IO.Path]::GetTempPath()
Write-Host "tmp=$tmp"
$tmp_slash = $tmp -replace '\\', '/'
Write-Host "tmp_slash=$tmp_slash"
Write-Host "`n`n" -NoNewline | bash tools/test-avrdude -v -t "$tmp_slash" -e build/src/${{env.BUILD_TYPE}}/avrdude.exe -c "-C build/src/avrdude.conf" -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28"
# Installing requires non-existing python312_d.lib from swig_avrdude.vcxproj
#- name: Install
# run: cmake --build build --target install
- name: Archive build artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: build-msvc-${{matrix.arch}}
path: |
build/
!**/_deps/
!**/*.obj
- name: Move executables
run: |
mv build/src/${{env.BUILD_TYPE}}/avrdude.exe build/src
mv build/src/${{env.BUILD_TYPE}}/avrdude.pdb build/src
- name: Archive executables
uses: actions/upload-artifact@v3
with:
name: avrdude-msvc-${{matrix.arch}}
path: |
build/src/avrdude.exe
build/src/avrdude.pdb
build/src/avrdude.conf
mingw:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
strategy:
matrix:
include:
- { sys: mingw64, env: x86_64 }
- { sys: ucrt64, env: ucrt-x86_64 }
- { sys: clang64, env: clang-x86_64 }
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
install: >-
base-devel
mingw-w64-${{matrix.env}}-gcc
mingw-w64-${{matrix.env}}-cmake
mingw-w64-${{matrix.env}}-python
mingw-w64-${{matrix.env}}-swig
mingw-w64-${{matrix.env}}-libelf
mingw-w64-${{matrix.env}}-libusb
mingw-w64-${{matrix.env}}-libusb-compat-git
mingw-w64-${{matrix.env}}-hidapi
mingw-w64-${{matrix.env}}-libftdi
mingw-w64-${{matrix.env}}-libserialport
mingw-w64-${{matrix.env}}-readline
mingw-w64-${{matrix.env}}-ncurses
mingw-w64-${{matrix.env}}-termcap
- name: Configure
run: >-
cmake
-G"MSYS Makefiles"
-D DEBUG_CMAKE=1
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-B build
- name: Build
run: cmake --build build
- name: "Dryrun test (not installed)"
run: |
tmpdir="$PWD/tmp$$"
mkdir "$tmpdir"
echo "tmpdir=$tmpdir"
ls -lR "$tmpdir"
echo "TEMP=$TEMP"
ls -lR "$TEMP"
printf "\n\n" | ./tools/test-avrdude -v -t "$TEMP" -e build/src/avrdude.exe -c "-C build/src/avrdude.conf" -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28"
- name: Install
run: cmake --build build --target install
- name: "Dryrun test (installed)"
run: printf "\n\n" | ./tools/test-avrdude -v -t "$TEMP" -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28"
- name: Archive build artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: build-mingw-${{matrix.env}}
path: |
build/
- name: Archive executables
uses: actions/upload-artifact@v3
with:
name: avrdude-mingw-${{matrix.env}}
path: |
build/src/avrdude.exe
build/src/avrdude.conf