mirror of
https://github.com/espressif/esp-mqtt.git
synced 2025-07-30 10:48:06 +02:00
Adds publish connect to gh
Placeholder commit for testing
This commit is contained in:
54
.github/actions/build-app/action.yml
vendored
Normal file
54
.github/actions/build-app/action.yml
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
name: Build app
|
||||||
|
description: Build ESP-IDF applications
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
idf_version:
|
||||||
|
required: true
|
||||||
|
description: ESP-IDF version to use
|
||||||
|
target:
|
||||||
|
required: true
|
||||||
|
description: Target platform
|
||||||
|
app_name:
|
||||||
|
required: true
|
||||||
|
description: Application name
|
||||||
|
app_path:
|
||||||
|
required: true
|
||||||
|
description: Path to the application
|
||||||
|
build_dir:
|
||||||
|
required: false
|
||||||
|
description: Directory for build artifacts
|
||||||
|
default: build_@t_
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
artifacts_path:
|
||||||
|
description: "App path"
|
||||||
|
value: ${{ steps.set-path.outputs.artifacts_path }}
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
with:
|
||||||
|
key: ${{ inputs.idf_version }}-${{ inputs.target }}
|
||||||
|
- name: Install dependencies
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
. ${IDF_PATH}/export.sh
|
||||||
|
python -m pip install idf-build-apps
|
||||||
|
- name: Build ${{ inputs.app_name }} with IDF-${{ inputs.idf_version }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
. ${IDF_PATH}/export.sh
|
||||||
|
export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
|
||||||
|
export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes"
|
||||||
|
export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}"
|
||||||
|
rm -rf $IDF_PATH/components/mqtt/esp-mqtt
|
||||||
|
cp -r . $IDF_PATH/components/mqtt/esp-mqtt
|
||||||
|
IDF_CCACHE_ENABLE=1 idf-build-apps build --config-rules "sdkconfig.ci.*=" "=default" --collect-app-info build_info_${{ inputs.idf_version }}.json --build-dir ${{ inputs.build_dir }} -p ${{ inputs.app_path }} -t ${{ inputs.target }}
|
||||||
|
- name: Set app artifact path
|
||||||
|
id: set-path
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
artifacts_path=$(eval echo "${{ inputs.app_path }}")
|
||||||
|
echo "artifacts_path=$artifacts_path" >> "$GITHUB_OUTPUT"
|
52
.github/actions/target-pytest/action.yml
vendored
Normal file
52
.github/actions/target-pytest/action.yml
vendored
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
name: Target Pytest run
|
||||||
|
description: Run pytest test cases
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
target:
|
||||||
|
required: true
|
||||||
|
description: Target platform
|
||||||
|
app_name:
|
||||||
|
required: true
|
||||||
|
description: Application name
|
||||||
|
app_path:
|
||||||
|
required: true
|
||||||
|
description: Path to the application
|
||||||
|
build_dir:
|
||||||
|
required: false
|
||||||
|
description: Directory for build artifacts
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install Python packages
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
|
||||||
|
run: pip install --prefer-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pytest-custom_exit_code
|
||||||
|
- name: Run apps
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
pytest ${{inputs.app_path}} --ignore-glob '*/managed_components/*' --ignore=.github --target=${{ inputs.target }} --embedded-services esp,idf --build-dir build_esp32_default
|
||||||
|
# - name: Upload test results
|
||||||
|
# uses: actions/upload-artifact@v4
|
||||||
|
# if: always()
|
||||||
|
# with:
|
||||||
|
# name: ${{ env.TEST_RESULT_NAME }}
|
||||||
|
# path: ${{ env.TEST_RESULT_FILE }}
|
||||||
|
|
||||||
|
# publish-results:
|
||||||
|
# name: Publish Test results
|
||||||
|
# needs:
|
||||||
|
# - run-target
|
||||||
|
# if: github.repository_owner == 'espressif' && always() && github.event_name == 'pull_request' && needs.prepare.outputs.build_only == '0'
|
||||||
|
# runs-on: ubuntu-22.04
|
||||||
|
# steps:
|
||||||
|
# - name: Download Test results
|
||||||
|
# uses: actions/download-artifact@v4
|
||||||
|
# with:
|
||||||
|
# pattern: test_results_*
|
||||||
|
# path: test_results
|
||||||
|
# - name: Publish Test Results
|
||||||
|
# uses: EnricoMi/publish-unit-test-result-action@v2
|
||||||
|
# with:
|
||||||
|
# files: test_results/**/*.xml path: build/*.xml
|
26
.github/workflows/build-and-target-test.yml
vendored
26
.github/workflows/build-and-target-test.yml
vendored
@ -16,22 +16,20 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-app:
|
build-app:
|
||||||
uses: "./.github/workflows/build-app.yml"
|
uses: "./.github/workflows/build-app.yml"
|
||||||
with:
|
with:
|
||||||
idf_version: ${{inputs.idf_version}}
|
idf_version: ${{inputs.idf_version}}
|
||||||
target: ${{inputs.target}}
|
target: ${{inputs.target}}
|
||||||
app_name: ${{inputs.app_name}}
|
app_name: ${{inputs.app_name}}
|
||||||
app_path: ${{inputs.app_path}}
|
app_path: ${{inputs.app_path}}
|
||||||
|
|
||||||
# run-on-target:
|
|
||||||
# needs: build-app
|
|
||||||
# uses: "./.github/workflows/run-on-target.yml"
|
|
||||||
# with:
|
|
||||||
# idf_version: ${{inputs.idf_version}}
|
|
||||||
# target: ${{inputs.target}}
|
|
||||||
# app_name: ${{inputs.app_name}}
|
|
||||||
# app_path: ${{inputs.app_path}}
|
|
||||||
|
|
||||||
|
run-on-target:
|
||||||
|
needs: build-app
|
||||||
|
uses: "./.github/workflows/run-on-target.yml"
|
||||||
|
with:
|
||||||
|
idf_version: ${{inputs.idf_version}}
|
||||||
|
target: ${{inputs.target}}
|
||||||
|
app_name: ${{inputs.app_name}}
|
||||||
|
app_path: ${{inputs.app_path}}
|
||||||
|
66
.github/workflows/build-app.yml
vendored
66
.github/workflows/build-app.yml
vendored
@ -22,38 +22,38 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build App
|
name: Build App
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-24.04
|
||||||
container: espressif/idf:${{inputs.idf_version}}
|
container: espressif/idf:${{inputs.idf_version}}
|
||||||
steps:
|
steps:
|
||||||
- if: ${{ env.ACT }}
|
- if: ${{ env.ACT }}
|
||||||
name: Add node for local tests
|
name: Add node for local tests
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
|
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
||||||
apt-get install -y nodejs
|
apt-get install -y nodejs
|
||||||
- name: Checkout esp-mqtt
|
- name: Checkout esp-mqtt
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: ccache
|
- name: ccache
|
||||||
uses: hendrikmuhs/ccache-action@v1.2
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
with:
|
with:
|
||||||
key: ${{inputs.idf_version}}-${{inputs.target}}
|
key: ${{inputs.idf_version}}-${{inputs.target}}
|
||||||
- name: Build ${{ inputs.app_name }} with IDF-${{ inputs.idf_version }}
|
- name: Build ${{ inputs.app_name }} with IDF-${{ inputs.idf_version }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
${IDF_PATH}/install.sh --enable-pytest
|
${IDF_PATH}/install.sh
|
||||||
. ${IDF_PATH}/export.sh
|
. ${IDF_PATH}/export.sh
|
||||||
python -m pip install idf-build-apps
|
python -m pip install idf-build-apps
|
||||||
rm -rf $IDF_PATH/components/mqtt/esp-mqtt
|
rm -rf $IDF_PATH/components/mqtt/esp-mqtt
|
||||||
cp -r . $IDF_PATH/components/mqtt/esp-mqtt
|
cp -r . $IDF_PATH/components/mqtt/esp-mqtt
|
||||||
IDF_CCACHE_ENABLE=1 idf-build-apps build --config-file ci/idf_build_apps.toml -p ${{inputs.app_path}} -t ${{inputs.target}}
|
IDF_CCACHE_ENABLE=1 idf-build-apps build --config-file ci/idf_build_apps.toml -p ${{inputs.app_path}} -t ${{inputs.target}}
|
||||||
- name: Upload files to artifacts for run-target job
|
- name: Upload files to artifacts for run-target job
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
if: ${{inputs.upload_artifacts}}
|
if: ${{inputs.upload_artifacts}}
|
||||||
with:
|
with:
|
||||||
name: mqtt_bin_${{inputs.target}}_${{ inputs.idf_version }}_${{ inputs.app_name }}
|
name: mqtt_bin_${{inputs.target}}_${{ inputs.idf_version }}_${{ inputs.app_name }}
|
||||||
path: |
|
path: |
|
||||||
build_${{inputs.target}}_${{inputs.app_name}}/bootloader/bootloader.bin
|
build_${{inputs.target}}_${{inputs.app_name}}/bootloader/bootloader.bin
|
||||||
build_${{inputs.target}}_${{inputs.app_name}}/partition_table/partition-table.bin
|
build_${{inputs.target}}_${{inputs.app_name}}/partition_table/partition-table.bin
|
||||||
build_${{inputs.target}}_${{inputs.app_name}}/*.bin
|
build_${{inputs.target}}_${{inputs.app_name}}/*.bin
|
||||||
build_${{inputs.target}}_${{inputs.app_name}}/*.elf
|
build_${{inputs.target}}_${{inputs.app_name}}/*.elf
|
||||||
build_${{inputs.target}}_${{inputs.app_name}}/flasher_args.json
|
build_${{inputs.target}}_${{inputs.app_name}}/flasher_args.json
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
150
.github/workflows/mqtt__host-tests.yml
vendored
150
.github/workflows/mqtt__host-tests.yml
vendored
@ -1,80 +1,80 @@
|
|||||||
name: "esp-mqtt: host-tests"
|
name: "esp-mqtt: host-tests"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened, labeled]
|
types: [opened, synchronize, reopened, labeled]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
host_test_esp_mqtt:
|
host_test_esp_mqtt:
|
||||||
name: Host Tests
|
name: Host Tests
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
container: espressif/idf:latest
|
container: espressif/idf:latest
|
||||||
env:
|
env:
|
||||||
COMP_DIR: components/mqtt/esp-mqtt
|
COMP_DIR: components/mqtt/esp-mqtt
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout esp-mqtt
|
- name: Checkout esp-mqtt
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Build and Test
|
- name: Build and Test
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
apt-get update && apt-get install -y gcc g++ python3-pip rsync
|
apt-get update && apt-get install -y gcc g++ python3-pip rsync
|
||||||
${IDF_PATH}/install.sh
|
${IDF_PATH}/install.sh
|
||||||
. ${IDF_PATH}/export.sh
|
. ${IDF_PATH}/export.sh
|
||||||
echo "IDF_PATH=${IDF_PATH}" >> $GITHUB_ENV
|
echo "IDF_PATH=${IDF_PATH}" >> $GITHUB_ENV
|
||||||
rm -rf $IDF_PATH/${{ env.COMP_DIR }}
|
rm -rf $IDF_PATH/${{ env.COMP_DIR }}
|
||||||
cp -r . $IDF_PATH/${{ env.COMP_DIR }}
|
cp -r . $IDF_PATH/${{ env.COMP_DIR }}
|
||||||
cd $IDF_PATH/${{ env.COMP_DIR }}/host_test
|
cd $IDF_PATH/${{ env.COMP_DIR }}/host_test
|
||||||
idf.py build
|
idf.py build
|
||||||
./build/host_mqtt_client_test.elf -r junit -o junit.xml
|
./build/host_mqtt_client_test.elf -r junit -o junit.xml
|
||||||
- name: Build with Coverage Enabled
|
- name: Build with Coverage Enabled
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
. ${IDF_PATH}/export.sh
|
. ${IDF_PATH}/export.sh
|
||||||
cd $IDF_PATH/${{ env.COMP_DIR }}/host_test
|
cd $IDF_PATH/${{ env.COMP_DIR }}/host_test
|
||||||
cat sdkconfig.ci.coverage >> sdkconfig.defaults
|
cat sdkconfig.ci.coverage >> sdkconfig.defaults
|
||||||
rm -rf build sdkconfig
|
rm -rf build sdkconfig
|
||||||
idf.py build
|
idf.py build
|
||||||
./build/host_mqtt_client_test.elf
|
./build/host_mqtt_client_test.elf
|
||||||
- name: Run gcovr
|
- name: Run gcovr
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
python -m pip install gcovr --break-system-packages
|
python -m pip install gcovr --break-system-packages
|
||||||
cd $IDF_PATH/${{ env.COMP_DIR }}
|
cd $IDF_PATH/${{ env.COMP_DIR }}
|
||||||
gcov -b host_test/main/mqtt_client.c. -o `find . -name "mqtt_client*gcda" -exec dirname {} \;`
|
gcov -b host_test/main/mqtt_client.c. -o `find . -name "mqtt_client*gcda" -exec dirname {} \;`
|
||||||
gcovr --gcov-ignore-parse-errors -g -k -r . --html index.html -x esp_mqtt_coverage.xml
|
gcovr --gcov-ignore-parse-errors -g -k -r . --html index.html -x esp_mqtt_coverage.xml
|
||||||
mkdir docs_gcovr
|
mkdir docs_gcovr
|
||||||
mv index.html docs_gcovr
|
mv index.html docs_gcovr
|
||||||
touch docs_gcovr/.nojekyll
|
touch docs_gcovr/.nojekyll
|
||||||
cp -r docs_gcovr esp_mqtt_coverage.xml $GITHUB_WORKSPACE
|
cp -r docs_gcovr esp_mqtt_coverage.xml $GITHUB_WORKSPACE
|
||||||
- name: Code Coverage Summary Report
|
- name: Code Coverage Summary Report
|
||||||
uses: irongut/CodeCoverageSummary@v1.3.0
|
uses: irongut/CodeCoverageSummary@v1.3.0
|
||||||
with:
|
with:
|
||||||
filename: ${{ env.GITHUB_WORKSPACE }}/**/esp_mqtt_coverage.xml
|
filename: ${{ env.GITHUB_WORKSPACE }}/**/esp_mqtt_coverage.xml
|
||||||
badge: true
|
badge: true
|
||||||
fail_below_min: false
|
fail_below_min: false
|
||||||
format: markdown
|
format: markdown
|
||||||
hide_branch_rate: false
|
hide_branch_rate: false
|
||||||
hide_complexity: false
|
hide_complexity: false
|
||||||
indicators: true
|
indicators: true
|
||||||
output: both
|
output: both
|
||||||
thresholds: '60 80'
|
thresholds: "60 80"
|
||||||
- name: Write to Job Summary
|
- name: Write to Job Summary
|
||||||
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
|
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: docs_gcovr
|
name: docs_gcovr
|
||||||
path: ${{ env.IDF_PATH }}/${{ env.COMP_DIR }}/docs_gcovr
|
path: ${{ env.IDF_PATH }}/${{ env.COMP_DIR }}/docs_gcovr
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
- name: Deploy coverage summary
|
- name: Deploy coverage summary
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
uses: JamesIves/github-pages-deploy-action@v4.4.1
|
uses: JamesIves/github-pages-deploy-action@v4.4.1
|
||||||
with:
|
with:
|
||||||
branch: gh-pages
|
branch: gh-pages
|
||||||
folder: ${{ env.IDF_PATH }}/${{ env.COMP_DIR }}/docs_gcovr
|
folder: ${{ env.IDF_PATH }}/${{ env.COMP_DIR }}/docs_gcovr
|
||||||
|
137
.github/workflows/publish-connect.yml
vendored
Normal file
137
.github/workflows/publish-connect.yml
vendored
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
name: "Publish connect tests"
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened, labeled]
|
||||||
|
|
||||||
|
env:
|
||||||
|
target: esp32
|
||||||
|
idf_version: latest
|
||||||
|
app_name: publish_connect_test
|
||||||
|
app_path: $IDF_PATH/tools/test_apps/protocols/mqtt/publish_connect_test
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build Test App
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
env:
|
||||||
|
EXAMPLE_MQTT_BROKER_SSL: "mqtt.eclipseprojects.io:1883"
|
||||||
|
EXAMPLE_MQTT_BROKER_TCP: "mqtt.eclipseprojects.io:8883"
|
||||||
|
EXAMPLE_MQTT_BROKER_WS: "mqtt.eclipseprojects.io"
|
||||||
|
EXAMPLE_MQTT_BROKER_WSS: "mqtt.eclipseprojects.io"
|
||||||
|
outputs:
|
||||||
|
build_path: ${{steps.build.outputs.artifacts_path}}
|
||||||
|
container: espressif/idf:latest
|
||||||
|
steps:
|
||||||
|
- name: Add node for local tests
|
||||||
|
if: ${{ env.ACT }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
||||||
|
apt-get install -y nodejs
|
||||||
|
- name: Checkout esp-mqtt
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Build App
|
||||||
|
id: build
|
||||||
|
uses: ./.github/actions/build-app
|
||||||
|
with:
|
||||||
|
idf_version: latest
|
||||||
|
target: ${{env.target}}
|
||||||
|
app_name: ${{env.app_name}}
|
||||||
|
app_path: ${{env.app_path}}
|
||||||
|
build_dir: build_@t_@w
|
||||||
|
- name: Upload files to artifacts for run-target job
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: mqtt_bin_${{env.target}}_${{ env.idf_version }}_${{ env.app_name }}
|
||||||
|
path: |
|
||||||
|
${{steps.build.outputs.artifacts_path}}/build_*/bootloader/bootloader.bin
|
||||||
|
${{steps.build.outputs.artifacts_path}}/build_*/partition_table/partition-table.bin
|
||||||
|
${{steps.build.outputs.artifacts_path}}/build_*/*.bin
|
||||||
|
${{steps.build.outputs.artifacts_path}}/build_*/flasher_args.json
|
||||||
|
${{steps.build.outputs.artifacts_path}}/build_*/config/sdkconfig.json
|
||||||
|
${{steps.build.outputs.artifacts_path}}/sdkconfig
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
run-on-target:
|
||||||
|
# if: github.repository == 'espressif/esp-mqtt'
|
||||||
|
name: Publish and Connect target test
|
||||||
|
needs: build
|
||||||
|
# strategy:
|
||||||
|
# fail-fast: false
|
||||||
|
# matrix:
|
||||||
|
# idf_ver:
|
||||||
|
# - "release-v5.0"
|
||||||
|
# - "release-v5.1"
|
||||||
|
# - "release-v5.2"
|
||||||
|
# - "release-v5.3"
|
||||||
|
# - "release-v5.4"
|
||||||
|
# - "release-v5.5"
|
||||||
|
# - "latest"
|
||||||
|
# runner:
|
||||||
|
# - runs-on: "esp32"
|
||||||
|
# marker: "generic"
|
||||||
|
# target: "esp32"
|
||||||
|
# - runs-on: "ESP32-ETHERNET-KIT"
|
||||||
|
# marker: "ethernet"
|
||||||
|
# target: "esp32"
|
||||||
|
# - runs-on: "spi_nand_flash"
|
||||||
|
# marker: "spi_nand_flash"
|
||||||
|
# target: "esp32"
|
||||||
|
# env:
|
||||||
|
# TEST_RESULT_NAME: test_results_${{ matrix.runner.target }}_${{ matrix.runner.marker }}_${{ matrix.idf_ver }}
|
||||||
|
# TEST_RESULT_FILE: test_results_${{ matrix.runner.target }}_${{ matrix.runner.marker }}_${{ matrix.idf_ver }}.xml
|
||||||
|
# runs-on: [self-hosted, linux, docker, "${{ matrix.runner.runs-on }}"]
|
||||||
|
container:
|
||||||
|
image: python:3.11-bookworm
|
||||||
|
options: --privileged # Privileged mode has access to serial ports
|
||||||
|
runs-on: [self-hosted, linux, docker, ESP32-ETHERNET-KIT]
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
idf_version: ["latest"]
|
||||||
|
target: ["esp32"]
|
||||||
|
example:
|
||||||
|
[
|
||||||
|
{
|
||||||
|
name: publish_connect_test,
|
||||||
|
path: "publish_connect_test",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
steps:
|
||||||
|
- name: Add node for local tests
|
||||||
|
if: ${{ env.ACT }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
||||||
|
apt-get install -y nodejs
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Checkout IDF ${{inputs.idf_version}}
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: espressif/esp-idf
|
||||||
|
path: idf
|
||||||
|
ref: master
|
||||||
|
- name: Install Python packages
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
|
||||||
|
run: pip install --prefer-binary -r idf/tools/requirements/requirements.pytest.txt
|
||||||
|
- name: Download artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
id: artifacts
|
||||||
|
with:
|
||||||
|
name: mqtt_bin_${{env.target}}_${{ env.idf_version }}_${{ env.app_name }}
|
||||||
|
path: idf/tools/test_apps/protocols/mqtt/publish_connect_test
|
||||||
|
- name: Check json
|
||||||
|
shell: bash
|
||||||
|
run: cat idf/tools/test_apps/protocols/mqtt/publish_connect_test/build_esp32_default/config/sdkconfig.json
|
||||||
|
|
||||||
|
- name: Run app
|
||||||
|
uses: ./.github/actions/target-pytest
|
||||||
|
with:
|
||||||
|
target: esp32
|
||||||
|
app_name: publish_connnect_test
|
||||||
|
app_path: idf/tools/test_apps/protocols/mqtt/publish_connect_test
|
74
.github/workflows/run-on-target.yml
vendored
74
.github/workflows/run-on-target.yml
vendored
@ -24,41 +24,41 @@ jobs:
|
|||||||
IDF_PATH: idf
|
IDF_PATH: idf
|
||||||
runs-on: [self-hosted, ESP32-ETHERNET-KIT]
|
runs-on: [self-hosted, ESP32-ETHERNET-KIT]
|
||||||
steps:
|
steps:
|
||||||
- name: Select idf ref
|
- name: Select idf ref
|
||||||
id: detect_version
|
id: detect_version
|
||||||
run: |
|
run: |
|
||||||
if echo "${{inputs.idf_version}}" | grep "latest" -> /dev/null ; then
|
if echo "${{inputs.idf_version}}" | grep "latest" -> /dev/null ; then
|
||||||
echo ref="master" >> "$GITHUB_OUTPUT"
|
echo ref="master" >> "$GITHUB_OUTPUT"
|
||||||
else
|
else
|
||||||
echo ref="`echo ${{matrix.idf_version}} | sed -s "s/-/\//"`" >> "$GITHUB_OUTPUT"
|
echo ref="`echo ${{matrix.idf_version}} | sed -s "s/-/\//"`" >> "$GITHUB_OUTPUT"
|
||||||
fi
|
fi
|
||||||
- name: IP discovery
|
- name: IP discovery
|
||||||
id: detect_ip
|
id: detect_ip
|
||||||
run: |
|
run: |
|
||||||
apt-get update && apt-get install -y iproute2
|
apt-get update && apt-get install -y iproute2
|
||||||
ip route
|
ip route
|
||||||
echo runner_ip ="`ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'`" >> "$GITHUB_OUTPUT"
|
echo runner_ip ="`ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'`" >> "$GITHUB_OUTPUT"
|
||||||
- name: Checkout IDF ${{inputs.idf_version}}
|
- name: Checkout IDF ${{inputs.idf_version}}
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: espressif/esp-idf
|
repository: espressif/esp-idf
|
||||||
path: ${{env.IDF_PATH}}
|
path: ${{env.IDF_PATH}}
|
||||||
ref: ${{steps.detect_version.outputs.ref}}
|
ref: ${{steps.detect_version.outputs.ref}}
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
env:
|
env:
|
||||||
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
|
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
|
||||||
run: |
|
run: |
|
||||||
pip install --only-binary cryptography -r ${{env.IDF_PATH}}/tools/requirements/requirements.pytest.txt
|
pip install --only-binary cryptography -r ${{env.IDF_PATH}}/tools/requirements/requirements.pytest.txt
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: mqtt_bin_${{inputs.target}}_${{ inputs.idf_version }}_${{ inputs.app_name }}
|
name: mqtt_bin_${{inputs.target}}_${{ inputs.idf_version }}_${{ inputs.app_name }}
|
||||||
path: build
|
path: build
|
||||||
|
|
||||||
- name: Run ${{inputs.app_name}} application on ${{inputs.target}}
|
- name: Run ${{inputs.app_name}} application on ${{inputs.target}}
|
||||||
run: |
|
run: |
|
||||||
python -m pytest ${{inputs.app_path}} --log-cli-level DEBUG --app-path . --junit-xml=./results_${{inputs.app_name}}_${{inputs.idf_version}}.xml --target=${{inputs.target}}
|
python -m pytest ${{inputs.app_path}} --log-cli-level DEBUG --app-path . --junit-xml=./results_${{inputs.app_name}}_${{inputs.idf_version}}.xml --target=${{inputs.target}}
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: results_${{inputs.app_name}}_${{inputs.idf_version}}.xml
|
name: results_${{inputs.app_name}}_${{inputs.idf_version}}.xml
|
||||||
path: build/*.xml
|
path: build/*.xml
|
||||||
|
164
.github/workflows/test-examples.yml
vendored
164
.github/workflows/test-examples.yml
vendored
@ -1,52 +1,136 @@
|
|||||||
name: "Build example apps"
|
name: "Build example apps"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened, labeled]
|
types: [opened, synchronize, reopened, labeled]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cpp-compatibility:
|
build:
|
||||||
name: Cpp compatibility
|
name: Build Examples
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
idf_version: ["release-v5.0", "release-v5.1", "latest"]
|
idf_version:
|
||||||
target: ["esp32"]
|
[
|
||||||
example: [{name: cpp_compatibility, path: "build_test"}]
|
"release-v5.1",
|
||||||
uses: "./.github/workflows/build-app.yml"
|
"release-v5.2",
|
||||||
with:
|
"release-v5.3",
|
||||||
idf_version: ${{matrix.idf_version}}
|
"release-v5.4",
|
||||||
target: ${{matrix.target}}
|
"release-v5.5",
|
||||||
app_name: ${{matrix.example.name}}
|
"latest",
|
||||||
app_path: $IDF_PATH/tools/test_apps/protocols/mqtt/${{matrix.example.path}}
|
]
|
||||||
upload_artifacts: false
|
target: ["esp32", "esp32c6"]
|
||||||
build-only-example:
|
example:
|
||||||
name: Build Only Apps
|
[
|
||||||
strategy:
|
{
|
||||||
matrix:
|
name: tcp,
|
||||||
idf_version: ["release-v5.0", "release-v5.1", "latest"]
|
path: "mqtt/tcp",
|
||||||
target: ["esp32s2", "esp32c3", "esp32s3"]
|
base_path: "examples/protocols",
|
||||||
example: [{name: ssl_psk, path: "mqtt/ssl_psk"}, {name: ssl_ds, path: "mqtt/ssl_ds"}]
|
},
|
||||||
uses: "./.github/workflows/build-app.yml"
|
{
|
||||||
with:
|
name: ssl,
|
||||||
idf_version: ${{matrix.idf_version}}
|
path: "mqtt/ssl",
|
||||||
target: ${{matrix.target}}
|
base_path: "examples/protocols",
|
||||||
app_name: ${{matrix.example.name}}
|
},
|
||||||
app_path: $IDF_PATH/examples/protocols/${{matrix.example.path}}
|
{
|
||||||
|
name: ssl_mutual_auth,
|
||||||
|
path: "mqtt/ssl_mutual_auth",
|
||||||
|
base_path: "examples/protocols",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: ws,
|
||||||
|
path: "mqtt/ws",
|
||||||
|
base_path: "examples/protocols",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: wss,
|
||||||
|
path: "mqtt/wss",
|
||||||
|
base_path: "examples/protocols",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: ssl_psk,
|
||||||
|
path: "mqtt/ssl_psk",
|
||||||
|
base_path: "examples/protocols",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: ssl_ds,
|
||||||
|
path: "mqtt/ssl_ds",
|
||||||
|
base_path: "examples/protocols",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: cpp_compatibility,
|
||||||
|
path: "build_test",
|
||||||
|
base_path: "tools/test_apps/protocols/mqtt",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
container: espressif/idf:${{ matrix.idf_version }}
|
||||||
|
steps:
|
||||||
|
- name: Use Build App Composite Action
|
||||||
|
uses: "./.github/actions/build-app"
|
||||||
|
with:
|
||||||
|
idf_version: ${{matrix.idf_version}}
|
||||||
|
target: ${{matrix.target}}
|
||||||
|
app_name: ${{matrix.example.name}}
|
||||||
|
app_path: $IDF_PATH/${{matrix.example.base_path}}/${{matrix.example.path}}
|
||||||
|
|
||||||
build-examples:
|
build_publish_connect:
|
||||||
name: Build and Run on target
|
name: Build Publish Connect Test
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
idf_version: ["release-v5.0", "release-v5.1", "latest"]
|
idf_version: ["latest"]
|
||||||
target: ["esp32"]
|
target: ["esp32"]
|
||||||
example: [{name: tcp, path: "mqtt/tcp"}, {name: ssl, path: "mqtt/ssl"},{name: ssl_mutual_auth, path: "mqtt/ssl_mutual_auth"},{name: ws, path: "mqtt/ws"},{name: wss, path: "mqtt/wss"}]
|
app:
|
||||||
uses: "./.github/workflows/build-and-target-test.yml"
|
[
|
||||||
with:
|
{
|
||||||
idf_version: ${{matrix.idf_version}}
|
name: publish_connect_test,
|
||||||
target: ${{matrix.target}}
|
path: "publish_connect_test",
|
||||||
app_name: ${{matrix.example.name}}
|
},
|
||||||
app_path: $IDF_PATH/examples/protocols/${{matrix.example.path}}
|
]
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
container: espressif/idf:${{ matrix.idf_version }}
|
||||||
|
steps:
|
||||||
|
- name: Use Build App Composite Action
|
||||||
|
uses: "./.github/actions/build-app"
|
||||||
|
with:
|
||||||
|
idf_version: ${{matrix.idf_version}}
|
||||||
|
target: ${{matrix.target}}
|
||||||
|
app_name: ${{matrix.app.name}}
|
||||||
|
app_path: $IDF_PATH/tools/test_apps/protocols/mqtt/${{matrix.app.path}}
|
||||||
|
- name: Upload files to artifacts for run-target job
|
||||||
|
if: ${{ inputs.upload_artifacts }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: mqtt_bin_${{ inputs.target }}_${{ inputs.idf_version }}_${{ inputs.app_name }}
|
||||||
|
path: |
|
||||||
|
build_${{ inputs.target }}_${{ inputs.app_name }}/bootloader/bootloader.bin
|
||||||
|
build_${{ inputs.target }}_${{ inputs.app_name }}/partition_table/partition-table.bin
|
||||||
|
build_${{ inputs.target }}_${{ inputs.app_name }}/*.bin
|
||||||
|
build_${{ inputs.target }}_${{ inputs.app_name }}/*.elf
|
||||||
|
build_${{ inputs.target }}_${{ inputs.app_name }}/flasher_args.json
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
publish_connect_test:
|
||||||
|
name: Publish and Connect test
|
||||||
|
needs: build_publish_connect
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
idf_version: ["latest"]
|
||||||
|
target: ["esp32"]
|
||||||
|
example:
|
||||||
|
[
|
||||||
|
{
|
||||||
|
name: publish_connect_test,
|
||||||
|
path: "publish_connect_test",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
steps:
|
||||||
|
- name: Use Run on Target Composite Action
|
||||||
|
uses: "./.github/workflows/run-on-target.yml"
|
||||||
|
with:
|
||||||
|
idf_version: ${{matrix.idf_version}}
|
||||||
|
target: ${{matrix.target}}
|
||||||
|
app_name: ${{matrix.example.name}}
|
||||||
|
app_path: $IDF_PATH/tools/test_apps/protocols/mqtt/${{matrix.example.path}}
|
||||||
|
Reference in New Issue
Block a user