mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-23 07:17:29 +02:00
fix(ci): trigger PR jobs based on labels
This commit is contained in:
98
.github/workflows/asio__build-target-test.yml
vendored
Normal file
98
.github/workflows/asio__build-target-test.yml
vendored
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
name: "asio: build/target-tests"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened, labeled]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_asio:
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'asio')
|
||||||
|
name: Build
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
idf_ver: ["latest", "release-v5.0"]
|
||||||
|
idf_target: ["esp32", "esp32s2"]
|
||||||
|
example: ["asio_chat", "async_request", "socks4", "ssl_client_server", "tcp_echo_server", "udp_echo_server"]
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
container: espressif/idf:${{ matrix.idf_ver }}
|
||||||
|
env:
|
||||||
|
TEST_DIR: components/asio/examples
|
||||||
|
steps:
|
||||||
|
- name: Checkout esp-protocols
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
||||||
|
working-directory: ${{ env.TEST_DIR }}/${{ matrix.example }}
|
||||||
|
env:
|
||||||
|
IDF_TARGET: ${{ matrix.idf_target }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
. ${IDF_PATH}/export.sh
|
||||||
|
test -f sdkconfig.ci && cat sdkconfig.ci >> sdkconfig.defaults || echo "No sdkconfig.ci"
|
||||||
|
idf.py set-target ${{ matrix.idf_target }}
|
||||||
|
idf.py build
|
||||||
|
- name: Merge binaries with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} for ${{ matrix.example }}
|
||||||
|
working-directory: ${{ env.TEST_DIR }}/${{ matrix.example }}/build
|
||||||
|
env:
|
||||||
|
IDF_TARGET: ${{ matrix.idf_target }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
. ${IDF_PATH}/export.sh
|
||||||
|
esptool.py --chip ${{ matrix.idf_target }} merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }}
|
||||||
|
path: |
|
||||||
|
${{ env.TEST_DIR }}/${{ matrix.example }}/build/bootloader/bootloader.bin
|
||||||
|
${{ env.TEST_DIR }}/${{ matrix.example }}/build//partition_table/partition-table.bin
|
||||||
|
${{ env.TEST_DIR }}/${{ matrix.example }}/build/*.bin
|
||||||
|
${{ env.TEST_DIR }}/${{ matrix.example }}/build/*.elf
|
||||||
|
${{ env.TEST_DIR }}/${{ matrix.example }}/build/flasher_args.json
|
||||||
|
${{ env.TEST_DIR }}/${{ matrix.example }}/build/config/sdkconfig.h
|
||||||
|
${{ env.TEST_DIR }}/${{ matrix.example }}/build/config/sdkconfig.json
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
target_tests_asio:
|
||||||
|
# Skip running on forks since it won't have access to secrets
|
||||||
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'asio') && (github.repository == 'espressif/esp-protocols') }}
|
||||||
|
name: Target tests
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
idf_ver: ["latest", "release-v5.0"]
|
||||||
|
idf_target: ["esp32"]
|
||||||
|
example: ["asio_chat", "tcp_echo_server", "udp_echo_server", "ssl_client_server"]
|
||||||
|
needs: build_asio
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- ESP32-ETHERNET-KIT
|
||||||
|
env:
|
||||||
|
TEST_DIR: components/asio/examples
|
||||||
|
steps:
|
||||||
|
- name: Clear repository
|
||||||
|
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }}
|
||||||
|
path: ${{ env.TEST_DIR }}/${{ matrix.example }}/build
|
||||||
|
- name: Install Python packages
|
||||||
|
env:
|
||||||
|
PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple"
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -y dnsutils
|
||||||
|
- name: Download Example Test to target ${{ matrix.config }}
|
||||||
|
run: |
|
||||||
|
python -m esptool --chip ${{ matrix.idf_target }} write_flash 0x0 ${{ env.TEST_DIR }}/${{ matrix.example }}/build/flash_image.bin
|
||||||
|
- name: Run Example Test ${{ matrix.example }} on target
|
||||||
|
working-directory: ${{ env.TEST_DIR }}/${{ matrix.example }}
|
||||||
|
run: |
|
||||||
|
python -m pytest --log-cli-level DEBUG --junit-xml=./examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.config }}.xml --target=${{ matrix.idf_target }}
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }}
|
||||||
|
path: ${{ env.TEST_DIR }}/${{ matrix.example }}/*.xml
|
92
.github/workflows/gcov_analyzer.yml
vendored
92
.github/workflows/gcov_analyzer.yml
vendored
@ -1,92 +0,0 @@
|
|||||||
name: Code Coverage Analyzer
|
|
||||||
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
gcovr_analyzer_esp_modem:
|
|
||||||
name: Run gcovr on esp modem host test
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
container: espressif/idf:release-v4.3
|
|
||||||
env:
|
|
||||||
lwip: lwip-2.1.2
|
|
||||||
lwip_contrib: contrib-2.1.0
|
|
||||||
lwip_uri: http://download.savannah.nongnu.org/releases/lwip
|
|
||||||
COMP_DIR: esp-protocols/components/esp_modem
|
|
||||||
steps:
|
|
||||||
- name: Checkout esp-protocols
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
path: esp-protocols
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Build and Test
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get update && apt-get install -y gcc-8 g++-8 python3-pip
|
|
||||||
apt-get install -y rsync
|
|
||||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
|
||||||
export LWIP_PATH=`pwd`/${{ env.lwip }}
|
|
||||||
export LWIP_CONTRIB_PATH=`pwd`/${{ env.lwip_contrib }}
|
|
||||||
. ${IDF_PATH}/export.sh
|
|
||||||
${{ env.COMP_DIR }}/test/host_test/env.sh $lwip $lwip_uri $lwip_contrib
|
|
||||||
cd $GITHUB_WORKSPACE/${{ env.COMP_DIR }}/test/host_test
|
|
||||||
cat sdkconfig.ci.coverage >> sdkconfig.defaults
|
|
||||||
idf.py build
|
|
||||||
./build/host_modem_test.elf
|
|
||||||
- name: Run gcovr
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
python -m pip install gcovr
|
|
||||||
cd $GITHUB_WORKSPACE/${{ env.COMP_DIR }}
|
|
||||||
gcov-8 `find . -name "esp_modem*gcda" -printf '%h\n' | head -n 1`/*
|
|
||||||
gcovr --gcov-ignore-parse-errors -g -k -r . --html index.html -x esp_modem_coverage.xml
|
|
||||||
mkdir docs_gcovr
|
|
||||||
cp $GITHUB_WORKSPACE/${{ env.COMP_DIR }}/index.html docs_gcovr
|
|
||||||
touch docs_gcovr/.nojekyll
|
|
||||||
|
|
||||||
- name: Code Coverage Summary Report
|
|
||||||
uses: irongut/CodeCoverageSummary@v1.3.0
|
|
||||||
with:
|
|
||||||
filename: esp-protocols/**/esp_modem_coverage.xml
|
|
||||||
badge: true
|
|
||||||
fail_below_min: false
|
|
||||||
format: markdown
|
|
||||||
hide_branch_rate: false
|
|
||||||
hide_complexity: false
|
|
||||||
indicators: true
|
|
||||||
output: both
|
|
||||||
thresholds: '60 80'
|
|
||||||
|
|
||||||
- name: Write to Job Summary
|
|
||||||
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
- name: Upload artifacts
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: docs_gcovr
|
|
||||||
path: |
|
|
||||||
${{ env.COMP_DIR }}/docs_gcovr
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
# show_report_data:
|
|
||||||
# name: Publish-Results
|
|
||||||
# if: github.ref == 'refs/heads/master' || github.repository != 'espressif/esp-protocols'
|
|
||||||
# runs-on: ubuntu-22.04
|
|
||||||
# needs: gcovr_analyzer_esp_modem
|
|
||||||
# steps:
|
|
||||||
# - name: Checkout 🛎️
|
|
||||||
# uses: actions/checkout@v3
|
|
||||||
# with:
|
|
||||||
# persist-credentials: false
|
|
||||||
# - name: Download Artifacts
|
|
||||||
# uses: actions/download-artifact@v1
|
|
||||||
# with:
|
|
||||||
# name: docs_gcovr
|
|
||||||
#
|
|
||||||
# - name: Deploy generated docs
|
|
||||||
# uses: JamesIves/github-pages-deploy-action@v4
|
|
||||||
# with:
|
|
||||||
# branch: gh-pages
|
|
||||||
# folder: 'docs_gcovr'
|
|
33
.github/workflows/mdns__build-host-tests.yml
vendored
33
.github/workflows/mdns__build-host-tests.yml
vendored
@ -1,33 +0,0 @@
|
|||||||
name: "mdns: Build and Host tests"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- 'components/mdns/**'
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize, reopened, labeled]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
host_test_mdns:
|
|
||||||
if: contains(github.event.pull_request.labels.*.name, 'mdns')
|
|
||||||
name: Host test
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
container: espressif/idf:latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout esp-protocols
|
|
||||||
uses: actions/checkout@master
|
|
||||||
with:
|
|
||||||
path: esp-protocols
|
|
||||||
|
|
||||||
- name: Build and Test
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
apt-get update && apt-get install -y dnsutils gcc g++
|
|
||||||
. ${IDF_PATH}/export.sh
|
|
||||||
cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/tests/host_test
|
|
||||||
idf.py build
|
|
||||||
./build/mdns_host.elf &
|
|
||||||
dig +short -p 5353 @224.0.0.251 myesp.local > ip.txt
|
|
||||||
cat ip.txt | xargs dig +short -p 5353 @224.0.0.251 -x
|
|
||||||
cat ip.txt
|
|
@ -1,15 +1,49 @@
|
|||||||
name: Build and Run Test apps
|
name: "mdns: build/target-tests"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
branches:
|
||||||
- 'components/mdns/**'
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
types: [opened, synchronize, reopened, labeled]
|
||||||
- 'components/mdns/**'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build_mdns:
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'mdns')
|
||||||
|
name: Build
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
idf_ver: ["latest"]
|
||||||
|
idf_target: ["esp32", "esp32s2", "esp32c3"]
|
||||||
|
test: [ { app: example, path: "components/mdns/examples" }, { app: unit_test, path: "components/mdns/tests/unit_test" } ]
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
container: espressif/idf:${{ matrix.idf_ver }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout esp-protocols
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{ matrix.test.path }}
|
||||||
|
run: |
|
||||||
|
${IDF_PATH}/install.sh --enable-pytest
|
||||||
|
. ${IDF_PATH}/export.sh
|
||||||
|
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app
|
||||||
|
for dir in `ls -d build_*`; do
|
||||||
|
$GITHUB_WORKSPACE/ci/clean_build_artifacts.sh `pwd`/$dir
|
||||||
|
zip -qur artifacts.zip $dir
|
||||||
|
done
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
if: ${{ matrix.idf_target }} == "esp32"
|
||||||
|
with:
|
||||||
|
name: mdns_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
|
||||||
|
path: ${{ matrix.test.path }}/artifacts.zip
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
build_mdns_app:
|
build_mdns_app:
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'mdns')
|
||||||
|
name: Build Test Apps
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
idf_ver: ["latest"]
|
idf_ver: ["latest"]
|
||||||
@ -55,18 +89,18 @@ jobs:
|
|||||||
components/mdns/tests/test_apps/build_${{ matrix.idf_target }}_default/config/sdkconfig.json
|
components/mdns/tests/test_apps/build_${{ matrix.idf_target }}_default/config/sdkconfig.json
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
run-target-mdns-app:
|
target_test_apps_mdns:
|
||||||
|
# Skip running on forks since it won't have access to secrets
|
||||||
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'mdns') && (github.repository == 'espressif/esp-protocols') }}
|
||||||
|
name: Target Test Apps
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
idf_ver: ["latest"]
|
idf_ver: ["latest"]
|
||||||
idf_target: ["esp32"]
|
idf_target: ["esp32"]
|
||||||
name: Run mDNS Test apps on target
|
|
||||||
needs: build_mdns_app
|
needs: build_mdns_app
|
||||||
runs-on:
|
runs-on:
|
||||||
- self-hosted
|
- self-hosted
|
||||||
- ESP32-ETHERNET-KIT
|
- ESP32-ETHERNET-KIT
|
||||||
# Skip running on forks since it won't have access to secrets
|
|
||||||
if: github.repository == 'espressif/esp-protocols'
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clear repository
|
- name: Clear repository
|
||||||
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
|
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
|
||||||
@ -92,3 +126,44 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: test_apps_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
|
name: test_apps_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
|
||||||
path: components/mdns/tests/test_apps/*.xml
|
path: components/mdns/tests/test_apps/*.xml
|
||||||
|
|
||||||
|
target_tests_mdns:
|
||||||
|
# Skip running on forks since it won't have access to secrets
|
||||||
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'mdns') && (github.repository == 'espressif/esp-protocols') }}
|
||||||
|
name: Target Example and Unit tests
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
idf_ver: ["latest"]
|
||||||
|
idf_target: ["esp32"]
|
||||||
|
test: [ { app: example, path: "components/mdns/examples" }, { app: unit_test, path: "components/mdns/tests/unit_test" } ]
|
||||||
|
needs: build_mdns
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- ESP32-ETHERNET-KIT
|
||||||
|
steps:
|
||||||
|
- name: Clear repository
|
||||||
|
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: mdns_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
|
||||||
|
path: ${{ matrix.test.path }}/ci/
|
||||||
|
- name: Install Python packages
|
||||||
|
env:
|
||||||
|
PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple"
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -y dnsutils
|
||||||
|
- name: Run ${{ matrix.test.app }} application on ${{ matrix.idf_target }}
|
||||||
|
working-directory: ${{ matrix.test.path }}
|
||||||
|
run: |
|
||||||
|
unzip ci/artifacts.zip -d ci
|
||||||
|
for dir in `ls -d ci/build_*`; do
|
||||||
|
rm -rf build sdkconfig.defaults
|
||||||
|
mv $dir build
|
||||||
|
python -m pytest --log-cli-level DEBUG --junit-xml=./results_${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${dir#"ci/build_"}.xml --target=${{ matrix.idf_target }}
|
||||||
|
done
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: results_${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml
|
||||||
|
path: ${{ matrix.test.path }}/*.xml
|
61
.github/workflows/mdns__host-tests.yml
vendored
Normal file
61
.github/workflows/mdns__host-tests.yml
vendored
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
name: "mdns: host-tests"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened, labeled]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
host_test_mdns:
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'mdns')
|
||||||
|
name: Host test
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
container: espressif/idf:latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout esp-protocols
|
||||||
|
uses: actions/checkout@master
|
||||||
|
with:
|
||||||
|
path: esp-protocols
|
||||||
|
|
||||||
|
- name: Build and Test
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
apt-get update && apt-get install -y dnsutils gcc g++
|
||||||
|
. ${IDF_PATH}/export.sh
|
||||||
|
cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/tests/host_test
|
||||||
|
idf.py build
|
||||||
|
./build/mdns_host.elf &
|
||||||
|
dig +short -p 5353 @224.0.0.251 myesp.local > ip.txt
|
||||||
|
cat ip.txt | xargs dig +short -p 5353 @224.0.0.251 -x
|
||||||
|
cat ip.txt
|
||||||
|
|
||||||
|
build_afl_host_test_mdns:
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'mdns')
|
||||||
|
name: Build AFL host test
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
idf_ver: ["latest"]
|
||||||
|
idf_target: ["esp32"]
|
||||||
|
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
container: espressif/idf:${{ matrix.idf_ver }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout esp-protocols
|
||||||
|
uses: actions/checkout@master
|
||||||
|
with:
|
||||||
|
path: esp-protocols
|
||||||
|
- name: Install Necessary Libs
|
||||||
|
run: |
|
||||||
|
apt-get update -y
|
||||||
|
apt-get install -y libbsd-dev
|
||||||
|
- name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
||||||
|
env:
|
||||||
|
IDF_TARGET: ${{ matrix.idf_target }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
. ${IDF_PATH}/export.sh
|
||||||
|
cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/tests/test_afl_fuzz_host/
|
||||||
|
make INSTR=off
|
99
.github/workflows/modem__build-host-tests.yml
vendored
99
.github/workflows/modem__build-host-tests.yml
vendored
@ -1,15 +1,16 @@
|
|||||||
name: "esp-modem: Build and Host tests"
|
name: "esp-modem: build/host-tests"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
branches:
|
||||||
- 'components/esp_modem/**'
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened, labeled]
|
types: [opened, synchronize, reopened, labeled]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_esp_modem:
|
build_esp_modem:
|
||||||
if: contains(github.event.pull_request.labels.*.name, 'modem')
|
if: contains(github.event.pull_request.labels.*.name, 'modem')
|
||||||
|
name: Build
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
idf_ver: ["latest", "release-v4.2", "release-v4.3", "release-v4.4", "release-v5.0"]
|
idf_ver: ["latest", "release-v4.2", "release-v4.3", "release-v4.4", "release-v5.0"]
|
||||||
@ -46,7 +47,8 @@ jobs:
|
|||||||
python ./ci/build_apps.py components/esp_modem/examples/${{ matrix.example }}
|
python ./ci/build_apps.py components/esp_modem/examples/${{ matrix.example }}
|
||||||
|
|
||||||
host_test_esp_modem:
|
host_test_esp_modem:
|
||||||
name: esp-modem Build and Test on Host
|
if: contains(github.event.pull_request.labels.*.name, 'modem')
|
||||||
|
name: Host Tests
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
container: espressif/idf:release-v4.3
|
container: espressif/idf:release-v4.3
|
||||||
env:
|
env:
|
||||||
@ -80,3 +82,92 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
files: esp-protocols/components/esp_modem/test/host_test/junit.xml
|
files: esp-protocols/components/esp_modem/test/host_test/junit.xml
|
||||||
|
|
||||||
|
host_test_gcov_esp_modem:
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'modem')
|
||||||
|
name: Run gcovr on esp modem host test
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
container: espressif/idf:release-v4.3
|
||||||
|
env:
|
||||||
|
lwip: lwip-2.1.2
|
||||||
|
lwip_contrib: contrib-2.1.0
|
||||||
|
lwip_uri: http://download.savannah.nongnu.org/releases/lwip
|
||||||
|
COMP_DIR: esp-protocols/components/esp_modem
|
||||||
|
steps:
|
||||||
|
- name: Checkout esp-protocols
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
path: esp-protocols
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Build and Test
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get update && apt-get install -y gcc-8 g++-8 python3-pip
|
||||||
|
apt-get install -y rsync
|
||||||
|
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
export LWIP_PATH=`pwd`/${{ env.lwip }}
|
||||||
|
export LWIP_CONTRIB_PATH=`pwd`/${{ env.lwip_contrib }}
|
||||||
|
. ${IDF_PATH}/export.sh
|
||||||
|
${{ env.COMP_DIR }}/test/host_test/env.sh $lwip $lwip_uri $lwip_contrib
|
||||||
|
cd $GITHUB_WORKSPACE/${{ env.COMP_DIR }}/test/host_test
|
||||||
|
cat sdkconfig.ci.coverage >> sdkconfig.defaults
|
||||||
|
idf.py build
|
||||||
|
./build/host_modem_test.elf
|
||||||
|
- name: Run gcovr
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
python -m pip install gcovr
|
||||||
|
cd $GITHUB_WORKSPACE/${{ env.COMP_DIR }}
|
||||||
|
gcov-8 `find . -name "esp_modem*gcda" -printf '%h\n' | head -n 1`/*
|
||||||
|
gcovr --gcov-ignore-parse-errors -g -k -r . --html index.html -x esp_modem_coverage.xml
|
||||||
|
mkdir docs_gcovr
|
||||||
|
cp $GITHUB_WORKSPACE/${{ env.COMP_DIR }}/index.html docs_gcovr
|
||||||
|
touch docs_gcovr/.nojekyll
|
||||||
|
|
||||||
|
- name: Code Coverage Summary Report
|
||||||
|
uses: irongut/CodeCoverageSummary@v1.3.0
|
||||||
|
with:
|
||||||
|
filename: esp-protocols/**/esp_modem_coverage.xml
|
||||||
|
badge: true
|
||||||
|
fail_below_min: false
|
||||||
|
format: markdown
|
||||||
|
hide_branch_rate: false
|
||||||
|
hide_complexity: false
|
||||||
|
indicators: true
|
||||||
|
output: both
|
||||||
|
thresholds: '60 80'
|
||||||
|
|
||||||
|
- name: Write to Job Summary
|
||||||
|
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: docs_gcovr
|
||||||
|
path: |
|
||||||
|
${{ env.COMP_DIR }}/docs_gcovr
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
# show_report_data:
|
||||||
|
# name: Publish-Results
|
||||||
|
# if: github.ref == 'refs/heads/master' || github.repository != 'espressif/esp-protocols'
|
||||||
|
# runs-on: ubuntu-22.04
|
||||||
|
# needs: gcovr_analyzer_esp_modem
|
||||||
|
# steps:
|
||||||
|
# - name: Checkout 🛎️
|
||||||
|
# uses: actions/checkout@v3
|
||||||
|
# with:
|
||||||
|
# persist-credentials: false
|
||||||
|
# - name: Download Artifacts
|
||||||
|
# uses: actions/download-artifact@v1
|
||||||
|
# with:
|
||||||
|
# name: docs_gcovr
|
||||||
|
#
|
||||||
|
# - name: Deploy generated docs
|
||||||
|
# uses: JamesIves/github-pages-deploy-action@v4
|
||||||
|
# with:
|
||||||
|
# branch: gh-pages
|
||||||
|
# folder: 'docs_gcovr'
|
||||||
|
73
.github/workflows/modem__target-test.yml
vendored
Normal file
73
.github/workflows/modem__target-test.yml
vendored
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
name: "esp-modem: target-tests"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened, labeled]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_esp_modem_tests:
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'modem')
|
||||||
|
name: Build Target tests
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
idf_ver: ["latest"]
|
||||||
|
idf_target: ["esp32c3"]
|
||||||
|
test: [ { app: pppd, path: test/target }, { app: sim800_c3, path: examples/pppos_client } ]
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
container: espressif/idf:${{ matrix.idf_ver }}
|
||||||
|
env:
|
||||||
|
TEST_DIR: components/esp_modem/${{ matrix.test.path }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout esp-protocols
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- name: Build esp-modem target tests with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
||||||
|
env:
|
||||||
|
IDF_TARGET: ${{ matrix.idf_target }}
|
||||||
|
SDKCONFIG: sdkconfig.ci.${{ matrix.test.app }}
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{ env.TEST_DIR }}
|
||||||
|
run: |
|
||||||
|
. ${IDF_PATH}/export.sh
|
||||||
|
rm -rf sdkconfig build
|
||||||
|
[ -f ${SDKCONFIG} ] && cp ${SDKCONFIG} sdkconfig.defaults
|
||||||
|
idf.py set-target ${{ matrix.idf_target }}
|
||||||
|
idf.py build
|
||||||
|
$GITHUB_WORKSPACE/ci/clean_build_artifacts.sh ${GITHUB_WORKSPACE}/${TEST_DIR}/build
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: modem_target_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
|
||||||
|
path: ${{ env.TEST_DIR }}/build
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
target_tests_esp_modem:
|
||||||
|
# Skip running on forks since it won't have access to secrets
|
||||||
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'modem') && (github.repository == 'espressif/esp-protocols') }}
|
||||||
|
name: Run Target tests
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
idf_ver: ["latest"]
|
||||||
|
idf_target: ["esp32c3"]
|
||||||
|
test: [ { app: pppd, path: test/target }, { app: sim800_c3, path: examples/pppos_client } ]
|
||||||
|
needs: build_esp_modem_tests
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- BrnoRPI-GH006
|
||||||
|
env:
|
||||||
|
TEST_DIR: components/esp_modem/${{ matrix.test.path }}
|
||||||
|
steps:
|
||||||
|
- name: Clear repository
|
||||||
|
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: modem_target_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
|
||||||
|
path: ${{ env.TEST_DIR }}/build
|
||||||
|
- name: Run Example Test on target
|
||||||
|
working-directory: ${{ env.TEST_DIR }}
|
||||||
|
run: |
|
||||||
|
python -m pytest --log-cli-level DEBUG --target=${{ matrix.idf_target }}
|
32
.github/workflows/mqtt_cxx__build.yml
vendored
Normal file
32
.github/workflows/mqtt_cxx__build.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
name: "mqtt-cxx: build-tests"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened, labeled]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_esp_mqtt_cxx:
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'mqtt')
|
||||||
|
name: Build
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
idf_ver: ["latest", "release-v5.0"]
|
||||||
|
idf_target: ["esp32"]
|
||||||
|
test: [ { app: example, path: "components/esp_mqtt_cxx/examples" }]
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
container: espressif/idf:${{ matrix.idf_ver }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout esp-protocols
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{matrix.test.path}}
|
||||||
|
run: |
|
||||||
|
${IDF_PATH}/install.sh --enable-pytest
|
||||||
|
. ${IDF_PATH}/export.sh
|
||||||
|
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app
|
3
.github/workflows/pre_commit_check.yml
vendored
3
.github/workflows/pre_commit_check.yml
vendored
@ -1,6 +1,9 @@
|
|||||||
name: Check pre-commit rules
|
name: Check pre-commit rules
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, reopened, synchronize]
|
types: [opened, reopened, synchronize]
|
||||||
|
|
||||||
|
329
.github/workflows/target-test.yml
vendored
329
.github/workflows/target-test.yml
vendored
@ -1,329 +0,0 @@
|
|||||||
name: Build and Run Target tests
|
|
||||||
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build_mdns:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
idf_ver: ["latest"]
|
|
||||||
idf_target: ["esp32", "esp32s2", "esp32c3"]
|
|
||||||
test: [ { app: example, path: "components/mdns/examples" }, { app: unit_test, path: "components/mdns/tests/unit_test" } ]
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
container: espressif/idf:${{ matrix.idf_ver }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout esp-protocols
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ matrix.test.path }}
|
|
||||||
run: |
|
|
||||||
${IDF_PATH}/install.sh --enable-pytest
|
|
||||||
. ${IDF_PATH}/export.sh
|
|
||||||
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app
|
|
||||||
for dir in `ls -d build_*`; do
|
|
||||||
$GITHUB_WORKSPACE/ci/clean_build_artifacts.sh `pwd`/$dir
|
|
||||||
zip -qur artifacts.zip $dir
|
|
||||||
done
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: ${{ matrix.idf_target }} == "esp32"
|
|
||||||
with:
|
|
||||||
name: mdns_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
|
|
||||||
path: ${{ matrix.test.path }}/artifacts.zip
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
build_asio:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
idf_ver: ["latest"]
|
|
||||||
idf_target: ["esp32", "esp32s2"]
|
|
||||||
example: ["asio_chat", "async_request", "socks4", "ssl_client_server", "tcp_echo_server", "udp_echo_server"]
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
container: espressif/idf:${{ matrix.idf_ver }}
|
|
||||||
env:
|
|
||||||
TEST_DIR: components/asio/examples
|
|
||||||
steps:
|
|
||||||
- name: Checkout esp-protocols
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
|
||||||
working-directory: ${{ env.TEST_DIR }}/${{ matrix.example }}
|
|
||||||
env:
|
|
||||||
IDF_TARGET: ${{ matrix.idf_target }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
. ${IDF_PATH}/export.sh
|
|
||||||
test -f sdkconfig.ci && cat sdkconfig.ci >> sdkconfig.defaults || echo "No sdkconfig.ci"
|
|
||||||
idf.py set-target ${{ matrix.idf_target }}
|
|
||||||
idf.py build
|
|
||||||
- name: Merge binaries with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} for ${{ matrix.example }}
|
|
||||||
working-directory: ${{ env.TEST_DIR }}/${{ matrix.example }}/build
|
|
||||||
env:
|
|
||||||
IDF_TARGET: ${{ matrix.idf_target }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
. ${IDF_PATH}/export.sh
|
|
||||||
esptool.py --chip ${{ matrix.idf_target }} merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }}
|
|
||||||
path: |
|
|
||||||
${{ env.TEST_DIR }}/${{ matrix.example }}/build/bootloader/bootloader.bin
|
|
||||||
${{ env.TEST_DIR }}/${{ matrix.example }}/build//partition_table/partition-table.bin
|
|
||||||
${{ env.TEST_DIR }}/${{ matrix.example }}/build/*.bin
|
|
||||||
${{ env.TEST_DIR }}/${{ matrix.example }}/build/*.elf
|
|
||||||
${{ env.TEST_DIR }}/${{ matrix.example }}/build/flasher_args.json
|
|
||||||
${{ env.TEST_DIR }}/${{ matrix.example }}/build/config/sdkconfig.h
|
|
||||||
${{ env.TEST_DIR }}/${{ matrix.example }}/build/config/sdkconfig.json
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
|
|
||||||
build_websocket:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
idf_ver: ["release-v5.0", "latest"]
|
|
||||||
idf_target: ["esp32"]
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
container: espressif/idf:${{ matrix.idf_ver }}
|
|
||||||
env:
|
|
||||||
TEST_DIR: components/esp_websocket_client/examples
|
|
||||||
steps:
|
|
||||||
- name: Checkout esp-protocols
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
|
||||||
env:
|
|
||||||
IDF_TARGET: ${{ matrix.idf_target }}
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ env.TEST_DIR }}
|
|
||||||
run: |
|
|
||||||
. ${IDF_PATH}/export.sh
|
|
||||||
cat sdkconfig.ci >> sdkconfig.defaults
|
|
||||||
idf.py build
|
|
||||||
- name: Merge binaries
|
|
||||||
working-directory: ${{ env.TEST_DIR }}/build
|
|
||||||
env:
|
|
||||||
IDF_TARGET: ${{ matrix.idf_target }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
. ${IDF_PATH}/export.sh
|
|
||||||
esptool.py --chip ${{ matrix.idf_target }} merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
|
|
||||||
path: |
|
|
||||||
${{ env.TEST_DIR }}/build/bootloader/bootloader.bin
|
|
||||||
${{ env.TEST_DIR }}/build/partition_table/partition-table.bin
|
|
||||||
${{ env.TEST_DIR }}/build/*.bin
|
|
||||||
${{ env.TEST_DIR }}/build/*.elf
|
|
||||||
${{ env.TEST_DIR }}/build/flasher_args.json
|
|
||||||
${{ env.TEST_DIR }}/build/config/sdkconfig.h
|
|
||||||
${{ env.TEST_DIR }}/build/config/sdkconfig.json
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
build_esp_mqtt_cxx:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
idf_ver: ["latest", "release-v5.0"]
|
|
||||||
idf_target: ["esp32"]
|
|
||||||
test: [ { app: example, path: "components/esp_mqtt_cxx/examples" }]
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
container: espressif/idf:${{ matrix.idf_ver }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout esp-protocols
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{matrix.test.path}}
|
|
||||||
run: |
|
|
||||||
${IDF_PATH}/install.sh --enable-pytest
|
|
||||||
. ${IDF_PATH}/export.sh
|
|
||||||
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app
|
|
||||||
|
|
||||||
run-target-websocket:
|
|
||||||
name: Run Websocket Example Test on target
|
|
||||||
needs: build_websocket
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
idf_ver: ["release-v5.0", "latest"]
|
|
||||||
idf_target: ["esp32"]
|
|
||||||
runs-on:
|
|
||||||
- self-hosted
|
|
||||||
- ESP32-ETHERNET-KIT
|
|
||||||
env:
|
|
||||||
TEST_DIR: components/esp_websocket_client/examples
|
|
||||||
# Skip running on forks since it won't have access to secrets
|
|
||||||
if: github.repository == 'espressif/esp-protocols'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
|
|
||||||
path: ${{ env.TEST_DIR }}/build/
|
|
||||||
- name: Install Python packages
|
|
||||||
env:
|
|
||||||
PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple"
|
|
||||||
run: |
|
|
||||||
pip install --only-binary cryptography --extra-index-url https://dl.espressif.com/pypi/ -r $GITHUB_WORKSPACE/ci/requirements.txt
|
|
||||||
- name: Download Example Test to target
|
|
||||||
run: python -m esptool --chip ${{ matrix.idf_target }} write_flash 0x0 components/esp_websocket_client/examples/build/flash_image.bin
|
|
||||||
- name: Run Example Test on target
|
|
||||||
working-directory: ${{ env.TEST_DIR }}
|
|
||||||
run: |
|
|
||||||
python -m pytest --log-cli-level DEBUG --junit-xml=./examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml --target=${{ matrix.idf_target }}
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
|
|
||||||
path: ${{ env.TEST_DIR }}/*.xml
|
|
||||||
|
|
||||||
run-target-mdns:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
idf_ver: ["latest"]
|
|
||||||
idf_target: ["esp32"]
|
|
||||||
test: [ { app: example, path: "components/mdns/examples" }, { app: unit_test, path: "components/mdns/tests/unit_test" } ]
|
|
||||||
name: Run mDNS target tests
|
|
||||||
needs: build_mdns
|
|
||||||
runs-on:
|
|
||||||
- self-hosted
|
|
||||||
- ESP32-ETHERNET-KIT
|
|
||||||
# Skip running on forks since it won't have access to secrets
|
|
||||||
if: github.repository == 'espressif/esp-protocols'
|
|
||||||
steps:
|
|
||||||
- name: Clear repository
|
|
||||||
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: mdns_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
|
|
||||||
path: ${{ matrix.test.path }}/ci/
|
|
||||||
- name: Install Python packages
|
|
||||||
env:
|
|
||||||
PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple"
|
|
||||||
run: |
|
|
||||||
sudo apt-get install -y dnsutils
|
|
||||||
- name: Run ${{ matrix.test.app }} application on ${{ matrix.idf_target }}
|
|
||||||
working-directory: ${{ matrix.test.path }}
|
|
||||||
run: |
|
|
||||||
unzip ci/artifacts.zip -d ci
|
|
||||||
for dir in `ls -d ci/build_*`; do
|
|
||||||
rm -rf build sdkconfig.defaults
|
|
||||||
mv $dir build
|
|
||||||
python -m pytest --log-cli-level DEBUG --junit-xml=./results_${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${dir#"ci/build_"}.xml --target=${{ matrix.idf_target }}
|
|
||||||
done
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: results_${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml
|
|
||||||
path: ${{ matrix.test.path }}/*.xml
|
|
||||||
|
|
||||||
run-target-asio:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
idf_ver: ["latest"]
|
|
||||||
idf_target: ["esp32"]
|
|
||||||
example: ["asio_chat", "tcp_echo_server", "udp_echo_server", "ssl_client_server"]
|
|
||||||
name: Run ASIO Example Test on target
|
|
||||||
needs: build_asio
|
|
||||||
runs-on:
|
|
||||||
- self-hosted
|
|
||||||
- ESP32-ETHERNET-KIT
|
|
||||||
env:
|
|
||||||
TEST_DIR: components/asio/examples
|
|
||||||
# Skip running on forks since it won't have access to secrets
|
|
||||||
if: github.repository == 'espressif/esp-protocols'
|
|
||||||
steps:
|
|
||||||
- name: Clear repository
|
|
||||||
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }}
|
|
||||||
path: ${{ env.TEST_DIR }}/${{ matrix.example }}/build
|
|
||||||
- name: Install Python packages
|
|
||||||
env:
|
|
||||||
PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple"
|
|
||||||
run: |
|
|
||||||
sudo apt-get install -y dnsutils
|
|
||||||
- name: Download Example Test to target ${{ matrix.config }}
|
|
||||||
run: |
|
|
||||||
python -m esptool --chip ${{ matrix.idf_target }} write_flash 0x0 ${{ env.TEST_DIR }}/${{ matrix.example }}/build/flash_image.bin
|
|
||||||
- name: Run Example Test ${{ matrix.example }} on target
|
|
||||||
working-directory: ${{ env.TEST_DIR }}/${{ matrix.example }}
|
|
||||||
run: |
|
|
||||||
python -m pytest --log-cli-level DEBUG --junit-xml=./examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.config }}.xml --target=${{ matrix.idf_target }}
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }}
|
|
||||||
path: ${{ env.TEST_DIR }}/${{ matrix.example }}/*.xml
|
|
||||||
|
|
||||||
build_esp_modem_tests:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
idf_ver: ["latest"]
|
|
||||||
idf_target: ["esp32c3"]
|
|
||||||
test: [ { app: pppd, path: test/target }, { app: sim800, path: examples/pppos_client } ]
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
container: espressif/idf:${{ matrix.idf_ver }}
|
|
||||||
env:
|
|
||||||
TEST_DIR: components/esp_modem/${{ matrix.test.path }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout esp-protocols
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- name: Build esp-modem target tests with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
|
||||||
env:
|
|
||||||
IDF_TARGET: ${{ matrix.idf_target }}
|
|
||||||
SDKCONFIG: sdkconfig.ci.${{ matrix.test.app }}
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ env.TEST_DIR }}
|
|
||||||
run: |
|
|
||||||
. ${IDF_PATH}/export.sh
|
|
||||||
rm -rf sdkconfig build
|
|
||||||
[ -f ${SDKCONFIG} ] && cp ${SDKCONFIG} sdkconfig.defaults
|
|
||||||
idf.py set-target ${{ matrix.idf_target }}
|
|
||||||
idf.py build
|
|
||||||
$GITHUB_WORKSPACE/ci/clean_build_artifacts.sh ${GITHUB_WORKSPACE}/${TEST_DIR}/build
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: modem_target_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
|
|
||||||
path: ${{ env.TEST_DIR }}/build
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
run_esp_modem_tests:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
idf_ver: ["latest"]
|
|
||||||
idf_target: ["esp32c3"]
|
|
||||||
test: [ { app: pppd, path: test/target }, { app: sim800, path: examples/pppos_client } ]
|
|
||||||
name: Run esp_modem Test on target
|
|
||||||
needs: build_esp_modem_tests
|
|
||||||
runs-on:
|
|
||||||
- self-hosted
|
|
||||||
- BrnoRPI-GH006
|
|
||||||
env:
|
|
||||||
TEST_DIR: components/esp_modem/${{ matrix.test.path }}
|
|
||||||
# Skip running on forks since it won't have access to secrets
|
|
||||||
if: github.repository == 'espressif/esp-protocols'
|
|
||||||
steps:
|
|
||||||
- name: Clear repository
|
|
||||||
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: modem_target_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
|
|
||||||
path: ${{ env.TEST_DIR }}/build
|
|
||||||
- name: Run Example Test on target
|
|
||||||
working-directory: ${{ env.TEST_DIR }}
|
|
||||||
run: |
|
|
||||||
python -m pytest --log-cli-level DEBUG --target=${{ matrix.idf_target }}
|
|
30
.github/workflows/test_afl_fuzzer.yml
vendored
30
.github/workflows/test_afl_fuzzer.yml
vendored
@ -1,30 +0,0 @@
|
|||||||
name: AFL fuzzer compilation test
|
|
||||||
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
idf_ver: ["latest"]
|
|
||||||
idf_target: ["esp32"]
|
|
||||||
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
container: espressif/idf:${{ matrix.idf_ver }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout esp-protocols
|
|
||||||
uses: actions/checkout@master
|
|
||||||
with:
|
|
||||||
path: esp-protocols
|
|
||||||
- name: Install Necessary Libs
|
|
||||||
run: |
|
|
||||||
apt-get update -y
|
|
||||||
apt-get install -y libbsd-dev
|
|
||||||
- name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
|
||||||
env:
|
|
||||||
IDF_TARGET: ${{ matrix.idf_target }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
. ${IDF_PATH}/export.sh
|
|
||||||
cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/tests/test_afl_fuzz_host/
|
|
||||||
make INSTR=off
|
|
93
.github/workflows/websocket__build-target-test.yml
vendored
Normal file
93
.github/workflows/websocket__build-target-test.yml
vendored
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
name: "websocket: build/target-tests"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened, labeled]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_websocket:
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'websocket')
|
||||||
|
name: Build
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
idf_ver: ["release-v5.0", "latest"]
|
||||||
|
idf_target: ["esp32"]
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
container: espressif/idf:${{ matrix.idf_ver }}
|
||||||
|
env:
|
||||||
|
TEST_DIR: components/esp_websocket_client/examples
|
||||||
|
steps:
|
||||||
|
- name: Checkout esp-protocols
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
||||||
|
env:
|
||||||
|
IDF_TARGET: ${{ matrix.idf_target }}
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{ env.TEST_DIR }}
|
||||||
|
run: |
|
||||||
|
. ${IDF_PATH}/export.sh
|
||||||
|
cat sdkconfig.ci >> sdkconfig.defaults
|
||||||
|
idf.py build
|
||||||
|
- name: Merge binaries
|
||||||
|
working-directory: ${{ env.TEST_DIR }}/build
|
||||||
|
env:
|
||||||
|
IDF_TARGET: ${{ matrix.idf_target }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
. ${IDF_PATH}/export.sh
|
||||||
|
esptool.py --chip ${{ matrix.idf_target }} merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
|
||||||
|
path: |
|
||||||
|
${{ env.TEST_DIR }}/build/bootloader/bootloader.bin
|
||||||
|
${{ env.TEST_DIR }}/build/partition_table/partition-table.bin
|
||||||
|
${{ env.TEST_DIR }}/build/*.bin
|
||||||
|
${{ env.TEST_DIR }}/build/*.elf
|
||||||
|
${{ env.TEST_DIR }}/build/flasher_args.json
|
||||||
|
${{ env.TEST_DIR }}/build/config/sdkconfig.h
|
||||||
|
${{ env.TEST_DIR }}/build/config/sdkconfig.json
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
run-target-websocket:
|
||||||
|
# Skip running on forks since it won't have access to secrets
|
||||||
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'websocket') && (github.repository == 'espressif/esp-protocols') }}
|
||||||
|
name: Target test
|
||||||
|
needs: build_websocket
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
idf_ver: ["release-v5.0", "latest"]
|
||||||
|
idf_target: ["esp32"]
|
||||||
|
runs-on:
|
||||||
|
- self-hosted
|
||||||
|
- ESP32-ETHERNET-KIT
|
||||||
|
env:
|
||||||
|
TEST_DIR: components/esp_websocket_client/examples
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
|
||||||
|
path: ${{ env.TEST_DIR }}/build/
|
||||||
|
- name: Install Python packages
|
||||||
|
env:
|
||||||
|
PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple"
|
||||||
|
run: |
|
||||||
|
pip install --only-binary cryptography --extra-index-url https://dl.espressif.com/pypi/ -r $GITHUB_WORKSPACE/ci/requirements.txt
|
||||||
|
- name: Download Example Test to target
|
||||||
|
run: python -m esptool --chip ${{ matrix.idf_target }} write_flash 0x0 components/esp_websocket_client/examples/build/flash_image.bin
|
||||||
|
- name: Run Example Test on target
|
||||||
|
working-directory: ${{ env.TEST_DIR }}
|
||||||
|
run: |
|
||||||
|
python -m pytest --log-cli-level DEBUG --junit-xml=./examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml --target=${{ matrix.idf_target }}
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
|
||||||
|
path: ${{ env.TEST_DIR }}/*.xml
|
Reference in New Issue
Block a user