Skip to content

Commit 6efd772

Browse files
Adds publish connect to gh
Placeholder commit for testing
1 parent 6af4446 commit 6efd772

File tree

5 files changed

+222
-170
lines changed

5 files changed

+222
-170
lines changed

.github/workflows/build-and-target-test.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,20 @@ on:
1616
type: string
1717
required: true
1818

19-
2019
jobs:
2120
build-app:
2221
uses: "./.github/workflows/build-app.yml"
2322
with:
24-
idf_version: ${{inputs.idf_version}}
25-
target: ${{inputs.target}}
26-
app_name: ${{inputs.app_name}}
27-
app_path: ${{inputs.app_path}}
28-
29-
# run-on-target:
30-
# needs: build-app
31-
# uses: "./.github/workflows/run-on-target.yml"
32-
# with:
33-
# idf_version: ${{inputs.idf_version}}
34-
# target: ${{inputs.target}}
35-
# app_name: ${{inputs.app_name}}
36-
# app_path: ${{inputs.app_path}}
23+
idf_version: ${{inputs.idf_version}}
24+
target: ${{inputs.target}}
25+
app_name: ${{inputs.app_name}}
26+
app_path: ${{inputs.app_path}}
3727

28+
run-on-target:
29+
needs: build-app
30+
uses: "./.github/workflows/run-on-target.yml"
31+
with:
32+
idf_version: ${{inputs.idf_version}}
33+
target: ${{inputs.target}}
34+
app_name: ${{inputs.app_name}}
35+
app_path: ${{inputs.app_path}}

.github/workflows/build-app.yml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,38 @@ on:
2222
jobs:
2323
build:
2424
name: Build App
25-
runs-on: ubuntu-20.04
25+
runs-on: ubuntu-24.04
2626
container: espressif/idf:${{inputs.idf_version}}
2727
steps:
28-
- if: ${{ env.ACT }}
29-
name: Add node for local tests
30-
run: |
31-
curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
32-
apt-get install -y nodejs
33-
- name: Checkout esp-mqtt
34-
uses: actions/checkout@v4
35-
- name: ccache
36-
uses: hendrikmuhs/[email protected]
37-
with:
38-
key: ${{inputs.idf_version}}-${{inputs.target}}
39-
- name: Build ${{ inputs.app_name }} with IDF-${{ inputs.idf_version }}
40-
shell: bash
41-
run: |
42-
${IDF_PATH}/install.sh --enable-pytest
43-
. ${IDF_PATH}/export.sh
44-
python -m pip install idf-build-apps
45-
rm -rf $IDF_PATH/components/mqtt/esp-mqtt
46-
cp -r . $IDF_PATH/components/mqtt/esp-mqtt
47-
IDF_CCACHE_ENABLE=1 idf-build-apps build --config-file ci/idf_build_apps.toml -p ${{inputs.app_path}} -t ${{inputs.target}}
48-
- name: Upload files to artifacts for run-target job
49-
uses: actions/upload-artifact@v4
50-
if: ${{inputs.upload_artifacts}}
51-
with:
52-
name: mqtt_bin_${{inputs.target}}_${{ inputs.idf_version }}_${{ inputs.app_name }}
53-
path: |
54-
build_${{inputs.target}}_${{inputs.app_name}}/bootloader/bootloader.bin
55-
build_${{inputs.target}}_${{inputs.app_name}}/partition_table/partition-table.bin
56-
build_${{inputs.target}}_${{inputs.app_name}}/*.bin
57-
build_${{inputs.target}}_${{inputs.app_name}}/*.elf
58-
build_${{inputs.target}}_${{inputs.app_name}}/flasher_args.json
59-
if-no-files-found: error
28+
- if: ${{ env.ACT }}
29+
name: Add node for local tests
30+
run: |
31+
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
32+
apt-get install -y nodejs
33+
- name: Checkout esp-mqtt
34+
uses: actions/checkout@v4
35+
- name: ccache
36+
uses: hendrikmuhs/[email protected]
37+
with:
38+
key: ${{inputs.idf_version}}-${{inputs.target}}
39+
- name: Build ${{ inputs.app_name }} with IDF-${{ inputs.idf_version }}
40+
shell: bash
41+
run: |
42+
${IDF_PATH}/install.sh
43+
. ${IDF_PATH}/export.sh
44+
python -m pip install idf-build-apps
45+
rm -rf $IDF_PATH/components/mqtt/esp-mqtt
46+
cp -r . $IDF_PATH/components/mqtt/esp-mqtt
47+
IDF_CCACHE_ENABLE=1 idf-build-apps build --config-file ci/idf_build_apps.toml -p ${{inputs.app_path}} -t ${{inputs.target}}
48+
- name: Upload files to artifacts for run-target job
49+
uses: actions/upload-artifact@v4
50+
if: ${{inputs.upload_artifacts}}
51+
with:
52+
name: mqtt_bin_${{inputs.target}}_${{ inputs.idf_version }}_${{ inputs.app_name }}
53+
path: |
54+
build_${{inputs.target}}_${{inputs.app_name}}/bootloader/bootloader.bin
55+
build_${{inputs.target}}_${{inputs.app_name}}/partition_table/partition-table.bin
56+
build_${{inputs.target}}_${{inputs.app_name}}/*.bin
57+
build_${{inputs.target}}_${{inputs.app_name}}/*.elf
58+
build_${{inputs.target}}_${{inputs.app_name}}/flasher_args.json
59+
if-no-files-found: error
Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
11
name: "esp-mqtt: host-tests"
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
pull_request:
8-
types: [opened, synchronize, reopened, labeled]
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [opened, synchronize, reopened, labeled]
99

1010
jobs:
11-
host_test_esp_mqtt:
12-
name: Host Tests
13-
runs-on: ubuntu-22.04
14-
permissions:
15-
contents: write
16-
container: espressif/idf:latest
17-
env:
18-
COMP_DIR: components/mqtt/esp-mqtt
19-
steps:
20-
- name: Checkout esp-mqtt
21-
uses: actions/checkout@v4
22-
- name: Build and Test
23-
shell: bash
24-
run: |
25-
apt-get update && apt-get install -y gcc g++ python3-pip rsync
26-
${IDF_PATH}/install.sh
27-
. ${IDF_PATH}/export.sh
28-
echo "IDF_PATH=${IDF_PATH}" >> $GITHUB_ENV
29-
rm -rf $IDF_PATH/${{ env.COMP_DIR }}
30-
cp -r . $IDF_PATH/${{ env.COMP_DIR }}
31-
cd $IDF_PATH/${{ env.COMP_DIR }}/host_test
32-
idf.py build
33-
./build/host_mqtt_client_test.elf -r junit -o junit.xml
34-
- name: Build with Coverage Enabled
35-
shell: bash
36-
run: |
37-
. ${IDF_PATH}/export.sh
38-
cd $IDF_PATH/${{ env.COMP_DIR }}/host_test
39-
cat sdkconfig.ci.coverage >> sdkconfig.defaults
40-
rm -rf build sdkconfig
41-
idf.py build
42-
./build/host_mqtt_client_test.elf
43-
- name: Run gcovr
44-
shell: bash
45-
run: |
46-
python -m pip install gcovr --break-system-packages
47-
cd $IDF_PATH/${{ env.COMP_DIR }}
48-
gcov -b host_test/main/mqtt_client.c. -o `find . -name "mqtt_client*gcda" -exec dirname {} \;`
49-
gcovr --gcov-ignore-parse-errors -g -k -r . --html index.html -x esp_mqtt_coverage.xml
50-
mkdir docs_gcovr
51-
mv index.html docs_gcovr
52-
touch docs_gcovr/.nojekyll
53-
cp -r docs_gcovr esp_mqtt_coverage.xml $GITHUB_WORKSPACE
54-
- name: Code Coverage Summary Report
55-
uses: irongut/[email protected]
56-
with:
57-
filename: ${{ env.GITHUB_WORKSPACE }}/**/esp_mqtt_coverage.xml
58-
badge: true
59-
fail_below_min: false
60-
format: markdown
61-
hide_branch_rate: false
62-
hide_complexity: false
63-
indicators: true
64-
output: both
65-
thresholds: '60 80'
66-
- name: Write to Job Summary
67-
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
68-
- name: Upload artifacts
69-
uses: actions/upload-artifact@v4
70-
if: always()
71-
with:
72-
name: docs_gcovr
73-
path: ${{ env.IDF_PATH }}/${{ env.COMP_DIR }}/docs_gcovr
74-
if-no-files-found: error
75-
- name: Deploy coverage summary
76-
if: github.ref == 'refs/heads/master'
77-
uses: JamesIves/[email protected]
78-
with:
79-
branch: gh-pages
80-
folder: ${{ env.IDF_PATH }}/${{ env.COMP_DIR }}/docs_gcovr
11+
host_test_esp_mqtt:
12+
name: Host Tests
13+
runs-on: ubuntu-24.04
14+
permissions:
15+
contents: write
16+
container: espressif/idf:latest
17+
env:
18+
COMP_DIR: components/mqtt/esp-mqtt
19+
steps:
20+
- name: Checkout esp-mqtt
21+
uses: actions/checkout@v4
22+
- name: Build and Test
23+
shell: bash
24+
run: |
25+
apt-get update && apt-get install -y gcc g++ python3-pip rsync
26+
${IDF_PATH}/install.sh
27+
. ${IDF_PATH}/export.sh
28+
echo "IDF_PATH=${IDF_PATH}" >> $GITHUB_ENV
29+
rm -rf $IDF_PATH/${{ env.COMP_DIR }}
30+
cp -r . $IDF_PATH/${{ env.COMP_DIR }}
31+
cd $IDF_PATH/${{ env.COMP_DIR }}/host_test
32+
idf.py build
33+
./build/host_mqtt_client_test.elf -r junit -o junit.xml
34+
- name: Build with Coverage Enabled
35+
shell: bash
36+
run: |
37+
. ${IDF_PATH}/export.sh
38+
cd $IDF_PATH/${{ env.COMP_DIR }}/host_test
39+
cat sdkconfig.ci.coverage >> sdkconfig.defaults
40+
rm -rf build sdkconfig
41+
idf.py build
42+
./build/host_mqtt_client_test.elf
43+
- name: Run gcovr
44+
shell: bash
45+
run: |
46+
python -m pip install gcovr --break-system-packages
47+
cd $IDF_PATH/${{ env.COMP_DIR }}
48+
gcov -b host_test/main/mqtt_client.c. -o `find . -name "mqtt_client*gcda" -exec dirname {} \;`
49+
gcovr --gcov-ignore-parse-errors -g -k -r . --html index.html -x esp_mqtt_coverage.xml
50+
mkdir docs_gcovr
51+
mv index.html docs_gcovr
52+
touch docs_gcovr/.nojekyll
53+
cp -r docs_gcovr esp_mqtt_coverage.xml $GITHUB_WORKSPACE
54+
- name: Code Coverage Summary Report
55+
uses: irongut/[email protected]
56+
with:
57+
filename: ${{ env.GITHUB_WORKSPACE }}/**/esp_mqtt_coverage.xml
58+
badge: true
59+
fail_below_min: false
60+
format: markdown
61+
hide_branch_rate: false
62+
hide_complexity: false
63+
indicators: true
64+
output: both
65+
thresholds: "60 80"
66+
- name: Write to Job Summary
67+
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
68+
- name: Upload artifacts
69+
uses: actions/upload-artifact@v4
70+
if: always()
71+
with:
72+
name: docs_gcovr
73+
path: ${{ env.IDF_PATH }}/${{ env.COMP_DIR }}/docs_gcovr
74+
if-no-files-found: error
75+
- name: Deploy coverage summary
76+
if: github.ref == 'refs/heads/master'
77+
uses: JamesIves/[email protected]
78+
with:
79+
branch: gh-pages
80+
folder: ${{ env.IDF_PATH }}/${{ env.COMP_DIR }}/docs_gcovr

.github/workflows/run-on-target.yml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -24,41 +24,41 @@ jobs:
2424
IDF_PATH: idf
2525
runs-on: [self-hosted, ESP32-ETHERNET-KIT]
2626
steps:
27-
- name: Select idf ref
28-
id: detect_version
29-
run: |
30-
if echo "${{inputs.idf_version}}" | grep "latest" -> /dev/null ; then
31-
echo ref="master" >> "$GITHUB_OUTPUT"
32-
else
33-
echo ref="`echo ${{matrix.idf_version}} | sed -s "s/-/\//"`" >> "$GITHUB_OUTPUT"
34-
fi
35-
- name: IP discovery
36-
id: detect_ip
37-
run: |
38-
apt-get update && apt-get install -y iproute2
39-
ip route
40-
echo runner_ip ="`ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'`" >> "$GITHUB_OUTPUT"
41-
- name: Checkout IDF ${{inputs.idf_version}}
42-
uses: actions/checkout@v4
43-
with:
44-
repository: espressif/esp-idf
45-
path: ${{env.IDF_PATH}}
46-
ref: ${{steps.detect_version.outputs.ref}}
47-
- name: Install Python packages
48-
env:
49-
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
50-
run: |
51-
pip install --only-binary cryptography -r ${{env.IDF_PATH}}/tools/requirements/requirements.pytest.txt
52-
- uses: actions/download-artifact@v4
53-
with:
54-
name: mqtt_bin_${{inputs.target}}_${{ inputs.idf_version }}_${{ inputs.app_name }}
55-
path: build
27+
- name: Select idf ref
28+
id: detect_version
29+
run: |
30+
if echo "${{inputs.idf_version}}" | grep "latest" -> /dev/null ; then
31+
echo ref="master" >> "$GITHUB_OUTPUT"
32+
else
33+
echo ref="`echo ${{matrix.idf_version}} | sed -s "s/-/\//"`" >> "$GITHUB_OUTPUT"
34+
fi
35+
- name: IP discovery
36+
id: detect_ip
37+
run: |
38+
apt-get update && apt-get install -y iproute2
39+
ip route
40+
echo runner_ip ="`ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'`" >> "$GITHUB_OUTPUT"
41+
- name: Checkout IDF ${{inputs.idf_version}}
42+
uses: actions/checkout@v4
43+
with:
44+
repository: espressif/esp-idf
45+
path: ${{env.IDF_PATH}}
46+
ref: ${{steps.detect_version.outputs.ref}}
47+
- name: Install Python packages
48+
env:
49+
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
50+
run: |
51+
pip install --only-binary cryptography -r ${{env.IDF_PATH}}/tools/requirements/requirements.pytest.txt
52+
- uses: actions/download-artifact@v4
53+
with:
54+
name: mqtt_bin_${{inputs.target}}_${{ inputs.idf_version }}_${{ inputs.app_name }}
55+
path: build
5656

57-
- name: Run ${{inputs.app_name}} application on ${{inputs.target}}
58-
run: |
59-
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}}
60-
- uses: actions/upload-artifact@v4
61-
if: always()
62-
with:
63-
name: results_${{inputs.app_name}}_${{inputs.idf_version}}.xml
64-
path: build/*.xml
57+
- name: Run ${{inputs.app_name}} application on ${{inputs.target}}
58+
run: |
59+
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}}
60+
- uses: actions/upload-artifact@v4
61+
if: always()
62+
with:
63+
name: results_${{inputs.app_name}}_${{inputs.idf_version}}.xml
64+
path: build/*.xml

0 commit comments

Comments
 (0)