feat(websocket): Added linux port for websocket (IDF-7097) #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "websocket: build/host-tests" | |
on: | |
push: | |
# branches: | |
# - master | |
pull_request: | |
types: [opened, synchronize, reopened, labeled] | |
jobs: | |
host_test_websocket: | |
if: contains(github.event.pull_request.labels.*.name, 'websocket') || github.event_name == 'push' | |
name: Host Tests | |
runs-on: ubuntu-20.04 | |
permissions: | |
contents: write | |
container: espressif/idf:latest | |
env: | |
COMP_DIR: esp-protocols/components/esp_websocket_client | |
steps: | |
- name: Checkout esp-protocols | |
uses: actions/checkout@v3 | |
with: | |
path: esp-protocols | |
- name: Build and Test | |
shell: bash | |
run: | | |
. ${IDF_PATH}/export.sh | |
cd $GITHUB_WORKSPACE/${{ env.COMP_DIR }}/test/host_test | |
idf.py build | |
./build/websocket-host.elf | |
- name: Build with Coverage Enabled | |
shell: bash | |
run: | | |
. ${IDF_PATH}/export.sh | |
cd $GITHUB_WORKSPACE/${{ env.COMP_DIR }}/test/host_test | |
cat sdkconfig.ci.coverage >> sdkconfig.defaults | |
rm -rf build sdkconfig | |
idf.py fullclean | |
idf.py build | |
./build/websocket-host.elf | |
- name: Run Coverage | |
shell: bash | |
run: | | |
apt-get update && apt-get install -y gcc-8 g++-8 python3-pip rsync | |
python -m pip install gcovr | |
cd $GITHUB_WORKSPACE/${{ env.COMP_DIR }} | |
gcov `find . -name "*gcda"` | |
gcovr --gcov-ignore-parse-errors -g -k -r . --html index.html -x websocket_coverage.xml | |
mkdir docs_gcovr_websocket | |
touch docs_gcovr_websocket/.nojekyll | |
cp $GITHUB_WORKSPACE/${{ env.COMP_DIR }}/index.html docs_gcovr_websocket | |
cp -rf docs_gcovr_websocket websocket_coverage.xml $GITHUB_WORKSPACE | |
- name: Code Coverage Summary Report | |
uses: irongut/[email protected] | |
with: | |
filename: esp-protocols/**/websocket_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_websocket | |
path: | | |
${{ env.COMP_DIR }}/docs_gcovr_websocket | |
if-no-files-found: error |