-
Notifications
You must be signed in to change notification settings - Fork 837
76 lines (71 loc) · 3 KB
/
build_template_esp32c3.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
name: Reusable esp32c3-at workflow template
on:
workflow_call:
# parameters from upstream workflow
inputs:
module_name:
required: true
type: string
artifacts_name:
required: true
type: string
# parameters from upstream inherit
secrets:
AT_OTA_TOKEN_ESP32C3_MINI:
required: false
jobs:
build-template-esp32c3:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: '3.10'
- name: Configure prerequisites
run: |
# set module information
mkdir build
echo -e "{\"platform\": \"PLATFORM_ESP32C3\", \"module\": \"${{ inputs.module_name }}\", \"silence\": 0}" > build/module_info.json
# enable full function for test job
if ${{ inputs.artifacts_name == 'esp32c3-at-full-function-test' }}; then
echo -e "CONFIG_AT_FS_COMMAND_SUPPORT=y" >> module_config/module_esp32c3_default/sdkconfig.defaults
echo -e "CONFIG_AT_DRIVER_COMMAND_SUPPORT=y" >> module_config/module_esp32c3_default/sdkconfig.defaults
echo -e "CONFIG_AT_EAP_COMMAND_SUPPORT=y" >> module_config/module_esp32c3_default/sdkconfig.defaults
echo -e "CONFIG_AT_WEB_SERVER_SUPPORT=y" >> module_config/module_esp32c3_default/sdkconfig.defaults
echo -e "CONFIG_AT_WEB_CAPTIVE_PORTAL_ENABLE=y" >> module_config/module_esp32c3_default/sdkconfig.defaults
# enlarge partition table
app0_size=`cat module_config/module_esp32c3_default/partitions_at.csv | grep ota_0 | awk -F, '{print $5}'`
app1_size=`cat module_config/module_esp32c3_default/partitions_at.csv | grep ota_1 | awk -F, '{print $5}'`
to_set_size=$((app0_size + app1_size))
sed -i '/ota_1/d' module_config/module_esp32c3_default/partitions_at.csv
to_set_hex_size=`printf "0x%x" ${to_set_size}`
sed -i '/ota_0/s,'"$app0_size"','"$to_set_hex_size"',g' module_config/module_esp32c3_default/partitions_at.csv
fi
# update esp32c3 ota token
cd components/at/private_include
rm -f at_ota_token.h
echo -e "#pragma once" >> at_ota_token.h
echo -e "#define CONFIG_ESP_AT_OTA_TOKEN_ESP32C3_MINI \"${{ secrets.AT_OTA_TOKEN_ESP32C3_MINI }}\"" >> at_ota_token.h
echo -e "#define CONFIG_ESP_AT_OTA_SSL_TOKEN_ESP32C3_MINI \"${{ secrets.AT_OTA_TOKEN_ESP32C3_MINI }}\"" >> at_ota_token.h
cd -
- name: Install ESP-IDF environment variables
run: |
./build.py install
- name: Compile
run: |
./build.py build
- name: Upload artifacts
uses: actions/[email protected]
with:
name: ${{ inputs.artifacts_name }}
path: |
sdkconfig
build/*.bin
build/*.elf
build/*.map
build/bootloader/*.bin
build/partition_table/*.bin
build/customized_partitions/*
build/flasher_args.json
build/download.config
build/factory/*