Skip to content

Commit

Permalink
test building and running pre_encrypted ota example
Browse files Browse the repository at this point in the history
  • Loading branch information
hmalpani committed Jan 11, 2024
1 parent e385c0c commit ff1d88f
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/pre_encrypted_ota_build_and_run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: "websocket: build/target-tests"

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]

jobs:
build_pre_encrypted_ota:
name: Build
strategy:
fail-fast: false
matrix:
idf_ver: ["release-v5.0", "release-v5.1", "latest"]
test: [ { app: example, path: "examples/pre_encrypted_ota" } ]
runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }}
env:
TEST_DIR: components/esp-encrypted_img/${{ matrix.test.path }}
steps:
- name: Checkout idf-extra-components
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
shell: bash
run: |
. ${IDF_PATH}/export.sh
python -m pip install idf-component-manager idf-build-apps --upgrade
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}"
idf-build-apps find -p ${TEST_DIR} --config sdkconfig.ci
idf-build-apps build -p ${TEST_DIR} --ignore-warning-file .ignore_build_warnings.txt --config sdkconfig.ci --parallel-index ${{ matrix.parallel_index }}
cd ${TEST_DIR}
for dir in `ls -d build_esp32_*`; do
find $1 ! -regex ".*/build[^/]*/[^/]+.\(bin\|elf\)" -a ! -regex ".*\(bootloader\|partition-table\).bin" -a ! -name "flasher_args.json" -a ! -regex ".*/build[^/]*/config/sdkconfig.\(h\|json\)" -delete || true
zip -qur artifacts.zip $dir
done
- uses: actions/upload-artifact@v3
with:
name: pre_encrypted_ota_bin_esp32_${{ matrix.idf_ver }}_${{ matrix.test.app }}
path: ${{ env.TEST_DIR }}/artifacts.zip
if-no-files-found: error

run-target-pre-encrypte-ota:
# Skip running on forks since it won't have access to secrets
name: Target test
needs: build_pre_encrypted_ota
strategy:
fail-fast: false
matrix:
idf_ver: ["release-v5.0", "release-v5.1", "latest"]
idf_target: ["esp32"]
test: [ { app: example, path: "examples/pre_encrypted_ota" }]
runs-on:
- self-hosted
- ESP32-ETHERNET-KIT
env:
TEST_DIR: components/esp_encrypted_ota/${{ matrix.test.path }}
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: pre_encrypted_ota_bin_esp32_${{ matrix.idf_ver }}_${{ matrix.test.app }}
# path: ${{ env.TEST_DIR }}/ci/
- name: Install Python packages
env:
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
run: |
pip install --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf rangehttpserver
- name: Run Pre Encrypted OTA Test on target
working-directory: ${{ env.TEST_DIR }}
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#"build_"}.xml --target=${{ matrix.idf_target }}
done

0 comments on commit ff1d88f

Please sign in to comment.