-
Notifications
You must be signed in to change notification settings - Fork 38
756 lines (666 loc) · 26.4 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
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
---
name: Build examples
on:
push:
pull_request:
branches:
- main
# include workflow_dispatch to enable manual trigger from Web UI.
workflow_dispatch:
jobs:
pre_build:
# A job to see if the entrire jobs should be skipped. each job for a
# target should have:
#
# needs: pre_build
# if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
concurrent_skipping: same_content
# if the change includes documentation, or ruby files changes only, skip.
paths_ignore: '["docs/**", "**/*.md", "*.md", "**/*.rb"]'
# but do not skip if the triggered event is one of these.
do_not_skip: '["workflow_dispatch", "schedule", "pull_request"]'
# XXX create multiple jobs for major versions
#
# for those who want to _refactor_ the jobs:
#
# in the previous CI implementation, all builds share a single build
# process. that way, you can remove duplications. however, every time a
# version changes the build process, the change affects all other build
# processes. I am tired of tracking changes and workarounds in the build
# process. the result is many `if`s. assuming major version does not change
# (a lot) its build process, creating multiple jobs, and using matrix is the
# only sane way. as GitHub Actions does not support reusable steps, there
# are many duplications. but no need to modify the entire build process to
# adopt changes in master.
build_esp32_master:
needs: pre_build
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- esp32
ip_version:
- ipv4
- ipv6
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
# XXX install python 3.8 because the official python package
# segfaults when installing modules in the runner.
#
# 2020-09-03T02:29:58.2517141Z Successfully installed cffi-1.14.2 cryptography-3.1 future-0.18.2 pycparser-2.20 pyparsing-2.3.1 pyserial-3.4 setuptools-50.1.0 six-1.15.0
# 2020-09-03T02:30:09.0409148Z /home/runner/work/_temp/66c91304-eef8-456d-84a1-7299428a62f7.sh: line 5: 4140 Segmentation fault (core dumped) python3 -m pip install --user -r ${IDF_PATH}/requirements.txt
# 2020-09-03T02:30:09.0414254Z ##[error]Process completed with exit code 139.
#
# possibly related issue:
# https://github.com/actions/virtual-environments/issues/159
python-version: 3.8
- name: Install dependencies
run: |
sudo apt-get install \
bison \
ccache \
flex \
gcc \
git \
gperf \
libffi-dev \
libncurses-dev \
libssl-dev \
make \
wget
- name: Set environment variables
id: set_env
run: |
SDK_NAME="esp-idf"
GCC_PREFIX="xtensa-${{ matrix.target }}-elf"
GCC_FILE="${GCC_PREFIX}-gcc"
TOOLCHAIN_DIR="${HOME}/.espressif/tools"
TOOLCHAIN_VERSION="esp-2021r2-8.4.0"
REPO_DIR=`pwd`
EXAMPLE_DIR="${REPO_DIR}/examples"
DISTFILE_DIR="${HOME}/distfiles"
__PROJECT_PATH=`pwd`
# XXX actions/checkout does not allow to checkout a repository other
# than under __PROJECT_PATH
IDF_PATH="${__PROJECT_PATH}/idf"
echo "IDF_PATH=${IDF_PATH}" >> ${GITHUB_ENV}
echo "IDF_TARGET=${{ matrix.target }}" >> ${GITHUB_ENV}
# cache-idf-tools needs __PROJECT_TOOLCHAIN_DIR
echo "::set-output name=PROJECT_TOOLCHAIN_DIR::${TOOLCHAIN_DIR}"
# XXX prefix all the environment variables with `__PROJECT_` to avoid pollution
echo "__PROJECT_EXAMPLE_DIR=${EXAMPLE_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_GCC_FILE=${GCC_FILE}" >> ${GITHUB_ENV}
echo "__PROJECT_GCC_PREFIX=${GCC_PREFIX}" >> ${GITHUB_ENV}
echo "__PROJECT_SDK_NAME=${SDK_NAME}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_DIR=${TOOLCHAIN_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION}" >> ${GITHUB_ENV}
echo "__PROJECT_DISTFILE_DIR=${DISTFILE_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_PATH=${__PROJECT_PATH}" >> ${GITHUB_ENV}
echo "__PROJECT_BUILD_COMMAND=${__PROJECT_BUILD_COMMAND}" >> ${GITHUB_ENV}
echo "__PROJECT_BUILD_COMMAND_ARG=${__PROJECT_BUILD_COMMAND_ARG}" >> ${GITHUB_ENV}
- name: Checkout the SDK
uses: actions/checkout@v2
with:
repository: espressif/esp-idf
path: idf
submodules: recursive
ref: master
- name: Fixup the SDK
run: |
# XXX workaround removed option, --no-site-packages, from virtualenv. should
# be removed when the following commit is merged
# https://github.com/espressif/esp-idf/commit/7a18f02acd7005f7c56e62175a8d1968a1a9019d
sed -i -e "s/'--no-site-packages',//" ${IDF_PATH}/tools/idf_tools.py
- name: Run idf_tools.py install
run: |
${IDF_PATH}/tools/idf_tools.py install
- name: Run idf_tools.py install-python-env
run: |
${IDF_PATH}/tools/idf_tools.py install-python-env
- name: Build (idf.py)
run: |
IGNORE_FILE="ci-ignore"
. ${IDF_PATH}/export.sh
# XXX share cache between examples.
# see "Compiling In Different Directories" in ccache(1)
# | | 4.0.1 | master |
# |----------------------------------------|---------|---------|
# | without ccache | 33m 42s | 50m 27s |
# | CCACHE_BASEDIR and CCACHE_NOHASHDIR | 10m 41s | 16m 38s |
export CCACHE_BASEDIR="${__PROJECT_EXAMPLE_DIR}"
export CCACHE_NOHASHDIR=true
cd "${__PROJECT_EXAMPLE_DIR}"
for i in $(ls -d *); do
if [ ! -e "${__PROJECT_EXAMPLE_DIR}/${i}/${IGNORE_FILE}" ]; then
cd "${__PROJECT_EXAMPLE_DIR}/${i}"
# FIXME Remove this workaround when esp-idf issue #7621 will be fixed
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n" >> sdkconfig.defaults
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n" >> sdkconfig.defaults
if [ ${{ matrix.ip_version }} == "ipv6" ]; then
echo "CONFIG_LWIP_IPV6=y" >> sdkconfig.defaults
fi
echo "Building ${i}..."
idf.py --ccache build
fi
done
build_esp32_v4_x:
needs: pre_build
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build_method:
- idf
branch:
# for supported versions by espressif, see:
# https://docs.espressif.com/projects/esp-idf/en/latest/esp32/versions.html
#
# see issue #2
# - v4.1.2
- v4.2.3
- v4.3.2
- v4.4.1
target:
- esp32
ip_version:
- ipv4
- ipv6
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
# XXX install python 3.8 because the official python package
# segfaults when installing modules in the runner.
#
# 2020-09-03T02:29:58.2517141Z Successfully installed cffi-1.14.2 cryptography-3.1 future-0.18.2 pycparser-2.20 pyparsing-2.3.1 pyserial-3.4 setuptools-50.1.0 six-1.15.0
# 2020-09-03T02:30:09.0409148Z /home/runner/work/_temp/66c91304-eef8-456d-84a1-7299428a62f7.sh: line 5: 4140 Segmentation fault (core dumped) python3 -m pip install --user -r ${IDF_PATH}/requirements.txt
# 2020-09-03T02:30:09.0414254Z ##[error]Process completed with exit code 139.
#
# possibly related issue:
# https://github.com/actions/virtual-environments/issues/159
python-version: 3.8
- name: Install dependencies
run: |
sudo apt-get install \
bison \
ccache \
flex \
gcc \
git \
gperf \
libffi-dev \
libncurses-dev \
libssl-dev \
make \
wget
- name: Set environment variables
id: set_env
run: |
SDK_NAME="esp-idf"
GCC_PREFIX="xtensa-${{ matrix.target }}-elf"
GCC_FILE="${GCC_PREFIX}-gcc"
TOOLCHAIN_DIR="${HOME}/.espressif/tools"
case "${{ matrix.branch }}" in
v4.0.*)
TOOLCHAIN_VERSION="esp-2020r3-8.4.0"
;;
v4.1.*)
TOOLCHAIN_VERSION="esp-2020r3-8.4.0"
;;
v4.2.*)
TOOLCHAIN_VERSION="esp-2020r3-8.4.0"
;;
v4.3.*)
TOOLCHAIN_VERSION="esp-2021r2-8.4.0"
;;
v4.4.*)
TOOLCHAIN_VERSION="esp-2021r2-patch3-8.4.0"
;;
*)
echo "Unknown matrix.branch: ${{ matrix.branch }}"
exit 1
;;
esac
REPO_DIR=`pwd`
EXAMPLE_DIR="${REPO_DIR}/examples"
DISTFILE_DIR="${HOME}/distfiles"
__PROJECT_PATH=`pwd`
# XXX actions/checkout does not allow to checkout a repository other
# than under __PROJECT_PATH
IDF_PATH="${__PROJECT_PATH}/idf"
echo "IDF_PATH=${IDF_PATH}" >> ${GITHUB_ENV}
echo "IDF_TARGET=${{ matrix.target }}" >> ${GITHUB_ENV}
# cache-idf-tools needs __PROJECT_TOOLCHAIN_DIR
echo "::set-output name=PROJECT_TOOLCHAIN_DIR::${TOOLCHAIN_DIR}"
# XXX prefix all the environment variables with `__PROJECT_` to avoid pollution
echo "__PROJECT_EXAMPLE_DIR=${EXAMPLE_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_GCC_FILE=${GCC_FILE}" >> ${GITHUB_ENV}
echo "__PROJECT_GCC_PREFIX=${GCC_PREFIX}" >> ${GITHUB_ENV}
echo "__PROJECT_SDK_NAME=${SDK_NAME}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_DIR=${TOOLCHAIN_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION}" >> ${GITHUB_ENV}
echo "__PROJECT_DISTFILE_DIR=${DISTFILE_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_PATH=${__PROJECT_PATH}" >> ${GITHUB_ENV}
echo "__PROJECT_BUILD_COMMAND=${__PROJECT_BUILD_COMMAND}" >> ${GITHUB_ENV}
echo "__PROJECT_BUILD_COMMAND_ARG=${__PROJECT_BUILD_COMMAND_ARG}" >> ${GITHUB_ENV}
- name: Checkout the SDK
uses: actions/checkout@v2
with:
repository: espressif/esp-idf
path: idf
submodules: recursive
ref: ${{ matrix.branch }}
- name: Fixup the SDK
run: |
# XXX workaround removed option, --no-site-packages, from virtualenv. should
# be removed when the following commit is merged
# https://github.com/espressif/esp-idf/commit/7a18f02acd7005f7c56e62175a8d1968a1a9019d
sed -i -e "s/'--no-site-packages',//" ${IDF_PATH}/tools/idf_tools.py
- name: Cache esp-idf tools
# cache esp-idf tools. each tagged branch has fixed versions of tools.
# the versions do not change. the master is an exception as it is a
# moving target. do NOT cache tools if the branch is master.
uses: actions/cache@v2
id: cache-tools
with:
path: ${{ steps.set_env.outputs.PROJECT_TOOLCHAIN_DIR }}
key: ${{ runner.os }}-${{ matrix.branch }}-${{ matrix.target }}-cache-tools
- name: Run idf_tools.py install
if: ${{ steps.cache-tools.outputs.cache-hit != 'true' }}
run: |
${IDF_PATH}/tools/idf_tools.py install
- name: Run idf_tools.py install-python-env
run: |
${IDF_PATH}/tools/idf_tools.py install-python-env
- name: Build (idf.py)
if: ${{ matrix.build_method == 'idf' }}
run: |
IGNORE_FILE="ci-ignore"
. ${IDF_PATH}/export.sh
# XXX share cache between examples.
# see "Compiling In Different Directories" in ccache(1)
# | | 4.0.1 | master |
# |----------------------------------------|---------|---------|
# | without ccache | 33m 42s | 50m 27s |
# | CCACHE_BASEDIR and CCACHE_NOHASHDIR | 10m 41s | 16m 38s |
export CCACHE_BASEDIR="${__PROJECT_EXAMPLE_DIR}"
export CCACHE_NOHASHDIR=true
cd "${__PROJECT_EXAMPLE_DIR}"
for i in $(ls -d *); do
if [ ! -e "${__PROJECT_EXAMPLE_DIR}/${i}/${IGNORE_FILE}" ]; then
cd "${__PROJECT_EXAMPLE_DIR}/${i}"
# FIXME Remove this workaround when esp-idf issue #7621 will be fixed
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n" >> sdkconfig.defaults
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n" >> sdkconfig.defaults
if [ ${{ matrix.ip_version }} == "ipv6" ]; then
echo "CONFIG_LWIP_IPV6=y" >> sdkconfig.defaults
fi
echo "Building ${i}..."
idf.py --ccache build
fi
done
build_esp8266:
runs-on: ubuntu-latest
needs: pre_build
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
strategy:
fail-fast: false
matrix:
build_method:
# XXX build examples with make only
# idf.py in ESP8266 RTOS SDK is broken in many ways.
- make
branch:
- v3.4
- master
ip_version:
- ipv4
- ipv6
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
sudo apt-get install \
bison \
ccache \
flex \
gcc \
git \
gperf \
libffi-dev \
libncurses-dev \
libssl-dev \
make \
wget
- name: Set environment variables
id: set_env
run: |
SDK_NAME="ESP8266_RTOS_SDK"
GCC_PREFIX="xtensa-lx106-elf"
GCC_FILE="${GCC_PREFIX}-gcc"
TOOLCHAIN_DIR="${HOME}/.espressif/tools"
REPO_DIR=`pwd`
EXAMPLE_DIR="${REPO_DIR}/examples"
__PROJECT_PATH=`pwd`
__PROJECT_TOOLCHAIN_VERSION="esp-2020r3-49-gd5524c1-8.4.0"
# XXX actions/checkout does not allow to checkout a repository other
# than under __PROJECT_PATH
IDF_PATH="${__PROJECT_PATH}/idf"
echo "IDF_PATH=${IDF_PATH}" >> ${GITHUB_ENV}
# cache-idf-tools needs PROJECT_TOOLCHAIN_DIR
echo "::set-output name=PROJECT_TOOLCHAIN_DIR::${TOOLCHAIN_DIR}"
# XXX prefix all the environment variables with `__PROJECT_` to avoid pollution
echo "__PROJECT_EXAMPLE_DIR=${EXAMPLE_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_GCC_FILE=${GCC_FILE}" >> ${GITHUB_ENV}
echo "__PROJECT_GCC_PREFIX=${GCC_PREFIX}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_DIR=${TOOLCHAIN_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_PATH=${__PROJECT_PATH}" >> ${GITHUB_ENV}
echo "__PROJECT_BUILD_COMMAND=${__PROJECT_BUILD_COMMAND}" >> ${GITHUB_ENV}
echo "__PROJECT_BUILD_COMMAND_ARG=${__PROJECT_BUILD_COMMAND_ARG}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_VERSION=${__PROJECT_TOOLCHAIN_VERSION}" >> ${GITHUB_ENV}
- name: Checkout the SDK
uses: actions/checkout@v2
with:
repository: espressif/ESP8266_RTOS_SDK
path: idf
submodules: recursive
ref: ${{ matrix.branch }}
# XXX git.eclipse.org does not allow to fetch a commit. fetch all
# the commits.
fetch-depth: 0
- name: Install python requirements (pip)
run: |
python -m pip install --user -r ${IDF_PATH}/requirements.txt
- name: Cache toolchain
id: cache-idf-tools
if: ${{ matrix.branch != 'master' }}
uses: actions/cache@v2
with:
path: ${{ steps.set_env.outputs.PROJECT_TOOLCHAIN_DIR }}
key: ${{ runner.os }}-${{ matrix.branch }}-esp8266-cache-tools
- name: Install toolchain
if: ${{ steps.cache-idf-tools.outputs.cache-hit != 'true' || matrix.branch == 'master' }}
run: |
${IDF_PATH}/install.sh
- name: Setup ccache (make)
run: |
__PROJECT_CCACHE_BIN_DIR="${HOME}/ccache_bin"
mkdir -p "${__PROJECT_CCACHE_BIN_DIR}"
(cd "${__PROJECT_CCACHE_BIN_DIR}" && ln -s /usr/bin/ccache "${__PROJECT_GCC_FILE}")
echo "PATH=${__PROJECT_CCACHE_BIN_DIR}:$PATH:${__PROJECT_TOOLCHAIN_DIR}/${__PROJECT_GCC_PREFIX}/${__PROJECT_TOOLCHAIN_VERSION}/${__PROJECT_GCC_PREFIX}/bin" >> ${GITHUB_ENV}
echo "CCACHE_BASEDIR=${__PROJECT_EXAMPLE_DIR}" >> ${GITHUB_ENV}
echo "CCACHE_NOHASHDIR=true" >> ${GITHUB_ENV}
- name: Build (make)
if: ${{ matrix.build_method == 'make' }}
run: |
IGNORE_FILE="ci-ignore-esp8266"
cd "${__PROJECT_EXAMPLE_DIR}"
for i in $(ls -d *); do
if [ ! -e "${__PROJECT_EXAMPLE_DIR}/${i}/${IGNORE_FILE}" ]; then
cd "${__PROJECT_EXAMPLE_DIR}/${i}"
# XXX ESP8266 RTOS SDK does not support
# `sdkconfig.defaults.TARGET_NAME` yet. create
# sdkconfig.defaults for ESP8266
echo "CONFIG_WIREGUARD_ESP_TCPIP_ADAPTER=y" >> sdkconfig.defaults
if [ ${{ matrix.ip_version }} == "ipv6" ]; then
echo "CONFIG_LWIP_IPV6=y" >> sdkconfig.defaults
fi
echo "Building ${i}..."
make defconfig
make -j$(nproc)
fi
done
# XXX esp32s2 support was introduced in v4.2. older esp-idf does not install
# toolchains for esp32s2. thus, you cannot add `esp32s2` target to
# build_esp32_v4_x.
#
# this job can be removed when either one of the followings are met:
#
# * GitHub Actions supports "early exit" (successfully exit if a condition is
# true).
# * all branches in build_esp32_v4_x supports esp32s2
#
# additionally, esp32s2 build requires idf.py. make is not supported.
build_esp32s2_v4_x:
runs-on: ubuntu-latest
needs: pre_build
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
strategy:
fail-fast: false
matrix:
build_method:
- idf
branch:
# esp32s2 support since v4.2.x
- master
- v4.2.2
- v4.3.1
- v4.4.1
target:
- esp32s2
ip_version:
- ipv4
- ipv6
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
sudo apt-get install \
bison \
ccache \
flex \
gcc \
git \
gperf \
libffi-dev \
libncurses-dev \
libssl-dev \
make \
wget
- name: Set environment variables
id: set_env
run: |
TOOLCHAIN_DIR="${HOME}/.espressif/tools"
REPO_DIR=`pwd`
EXAMPLE_DIR="${REPO_DIR}/examples"
__PROJECT_PATH=`pwd`
IDF_PATH="${__PROJECT_PATH}/idf"
# cache-idf-tools needs __PROJECT_TOOLCHAIN_DIR
echo "::set-output name=PROJECT_TOOLCHAIN_DIR::${TOOLCHAIN_DIR}"
echo "IDF_PATH=${IDF_PATH}" >> ${GITHUB_ENV}
echo "IDF_TARGET=${{ matrix.target }}" >> ${GITHUB_ENV}
echo "__PROJECT_EXAMPLE_DIR=${EXAMPLE_DIR}" >> ${GITHUB_ENV}
- name: Checkout the SDK
uses: actions/checkout@v2
with:
repository: espressif/esp-idf
path: idf
submodules: recursive
ref: ${{ matrix.branch }}
- name: Fixup the SDK
run: |
sed -i -e "s/'--no-site-packages',//" ${IDF_PATH}/tools/idf_tools.py
- name: Cache esp-idf tools
# cache esp-idf tools. each tagged branch has fixed versions of tools.
# the versions do not change. the master is an exception as it is a
# moving target. do NOT cache tools if the branch is master.
uses: actions/cache@v2
id: cache-tools
if: ${{ matrix.branch != 'master' }}
with:
path: ${{ steps.set_env.outputs.PROJECT_TOOLCHAIN_DIR }}
key: ${{ runner.os }}-${{ matrix.branch }}-${{ matrix.target }}-cache-tools
- name: Run install.sh
if: ${{ steps.cache-tools.outputs.cache-hit != 'true' || matrix.branch == 'master' }}
run: |
${IDF_PATH}/install.sh
- name: Run idf_tools.py install-python-env
run: |
${IDF_PATH}/tools/idf_tools.py install-python-env
- name: Build (idf.py)
if: ${{ matrix.build_method == 'idf' }}
run: |
IGNORE_FILE="ci-ignore"
. ${IDF_PATH}/export.sh
export CCACHE_BASEDIR="${__PROJECT_EXAMPLE_DIR}"
export CCACHE_NOHASHDIR=true
cd "${__PROJECT_EXAMPLE_DIR}"
for i in $(ls -d *); do
if [ ! -e "${__PROJECT_EXAMPLE_DIR}/${i}/${IGNORE_FILE}" ]; then
cd "${__PROJECT_EXAMPLE_DIR}/${i}"
echo "Building ${i}..."
# FIXME Remove this workaround when esp-idf issue #7621 will be fixed
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n" >> sdkconfig.defaults
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n" >> sdkconfig.defaults
if [ ${{ matrix.ip_version }} == "ipv6" ]; then
echo "CONFIG_LWIP_IPV6=y" >> sdkconfig.defaults
fi
idf.py --ccache build
fi
done
build_esp32c3_v4_x:
runs-on: ubuntu-latest
needs: pre_build
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
strategy:
fail-fast: false
matrix:
build_method:
- idf
branch:
# esp32c3 support was introduced in v4.3.
- master
- v4.3.2
target:
- esp32c3
ip_version:
- ipv4
- ipv6
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
sudo apt-get install \
bison \
ccache \
flex \
gcc \
git \
gperf \
libffi-dev \
libncurses-dev \
libssl-dev \
make \
wget
- name: Set environment variables
id: set_env
run: |
TOOLCHAIN_DIR="${HOME}/.espressif/tools"
REPO_DIR=`pwd`
EXAMPLE_DIR="${REPO_DIR}/examples"
__PROJECT_PATH=`pwd`
IDF_PATH="${__PROJECT_PATH}/idf"
# cache-idf-tools needs __PROJECT_TOOLCHAIN_DIR
echo "::set-output name=PROJECT_TOOLCHAIN_DIR::${TOOLCHAIN_DIR}"
echo "IDF_PATH=${IDF_PATH}" >> ${GITHUB_ENV}
echo "IDF_TARGET=${{ matrix.target }}" >> ${GITHUB_ENV}
echo "__PROJECT_EXAMPLE_DIR=${EXAMPLE_DIR}" >> ${GITHUB_ENV}
- name: Checkout the SDK
uses: actions/checkout@v2
with:
repository: espressif/esp-idf
path: idf
submodules: recursive
ref: ${{ matrix.branch }}
- name: Fixup the SDK
run: |
sed -i -e "s/'--no-site-packages',//" ${IDF_PATH}/tools/idf_tools.py
- name: Cache esp-idf tools
# cache esp-idf tools. each tagged branch has fixed versions of tools.
# the versions do not change. the master is an exception as it is a
# moving target. do NOT cache tools if the branch is master.
uses: actions/cache@v2
id: cache-tools
if: ${{ matrix.branch != 'master' }}
with:
path: ${{ steps.set_env.outputs.PROJECT_TOOLCHAIN_DIR }}
key: ${{ runner.os }}-${{ matrix.branch }}-${{ matrix.target }}-cache-tools-1
- name: Run install.sh
if: ${{ steps.cache-tools.outputs.cache-hit != 'true' || matrix.branch == 'master' }}
run: |
${IDF_PATH}/install.sh
- name: Run idf_tools.py install-python-env
run: |
${IDF_PATH}/tools/idf_tools.py install-python-env
- name: Build (idf.py)
if: ${{ matrix.build_method == 'idf' }}
run: |
IGNORE_FILE="ci-ignore"
. ${IDF_PATH}/export.sh
export CCACHE_BASEDIR="${__PROJECT_EXAMPLE_DIR}"
export CCACHE_NOHASHDIR=true
cd "${__PROJECT_EXAMPLE_DIR}"
for i in $(ls -d *); do
if [ ! -e "${__PROJECT_EXAMPLE_DIR}/${i}/${IGNORE_FILE}" ]; then
cd "${__PROJECT_EXAMPLE_DIR}/${i}"
echo "Building ${i}..."
# FIXME Remove this workaround when esp-idf issue #7621 will be fixed
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n" >> sdkconfig.defaults
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n" >> sdkconfig.defaults
if [ ${{ matrix.ip_version }} == "ipv6" ]; then
echo "CONFIG_LWIP_IPV6=y" >> sdkconfig.defaults
fi
idf.py --ccache build
fi
done
all_build:
# a meta job that requires all of the above so that repository
# admin can choose a single test name in "Require status checks to pass
# before merging". A trick obtained from:
#
# https://github.com/jazzband/pip-tools/issues/1085#issuecomment-619172509
name: All build
runs-on: ubuntu-latest
needs:
- build_esp32_master
- build_esp32_v4_x
- build_esp8266
- build_esp32s2_v4_x
- build_esp32c3_v4_x
steps:
- name:
run: |
echo "All builds finished"