Add support for esp32 network driver scanning for access points #4855
Workflow file for this run
This file contains hidden or 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
| # | |
| # Copyright 2022 Fred Dushin <fred@dushin.net> | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later | |
| # | |
| name: esp32-mkimage | |
| on: | |
| push: | |
| paths: | |
| - '.github/workflows/esp32-mkimage.yaml' | |
| - 'CMakeLists.txt' | |
| - 'CMakeModules/**' | |
| - 'libs/**' | |
| - 'src/platforms/esp32/**' | |
| - 'src/platforms/esp32/**/**' | |
| - 'src/libAtomVM/**' | |
| - 'tools/packbeam/**' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/esp32-mkimage.yaml' | |
| - 'CMakeLists.txt' | |
| - 'CMakeModules/**' | |
| - 'libs/**' | |
| - 'src/platforms/esp32/**' | |
| - 'src/platforms/esp32/**/**' | |
| - 'src/libAtomVM/**' | |
| - 'tools/packbeam/**' | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| esp32-release: | |
| runs-on: ubuntu-24.04 | |
| container: espressif/idf:v${{ matrix.idf-version }} | |
| strategy: | |
| matrix: | |
| idf-version: ["5.5.2"] | |
| cc: ["clang-14"] | |
| cxx: ["clang++-14"] | |
| cflags: ["-O3"] | |
| otp: ["27"] | |
| elixir_version: ["1.17"] | |
| rebar3_version: ["3.24.0"] | |
| compiler_pkgs: ["clang-14"] | |
| soc: ["esp32", "esp32c2", "esp32c3", "esp32s2", "esp32s3", "esp32c5", "esp32c6", "esp32c61", "esp32h2", "esp32p4", "esp32p4_pre", "esp32p4_c6", "esp32p4_pre_c6"] | |
| flavor: ["", "-elixir"] | |
| env: | |
| CC: ${{ matrix.cc }} | |
| CXX: ${{ matrix.cxx }} | |
| CFLAGS: ${{ matrix.cflags }} | |
| CXXFLAGS: ${{ matrix.cflags }} | |
| ImageOS: "ubuntu24" | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: ${{ matrix.otp }} | |
| elixir-version: ${{ matrix.elixir_version }} | |
| rebar3-version: ${{ matrix.rebar3_version }} | |
| hexpm-mirrors: | | |
| https://builds.hex.pm | |
| https://repo.hex.pm | |
| https://cdn.jsdelivr.net/hex | |
| - name: "APT update" | |
| run: apt update -y | |
| - name: "Install deps" | |
| run: DEBIAN_FRONTEND=noninteractive apt install -y ${{ matrix.compiler_pkgs}} git cmake gperf zlib1g-dev | |
| # needed for generating AtomVM version when running in a docker container | |
| - name: "Configure Git" | |
| run: | | |
| git config --global --add safe.directory /__w/AtomVM/AtomVM | |
| echo -n "git rev-parse: " | |
| git rev-parse --short HEAD | |
| # Builder info | |
| - name: "System info" | |
| run: | | |
| echo "**uname:**" | |
| uname -a | |
| echo "**libc version:**" | |
| ldd --version | |
| echo "**C Compiler version:**" | |
| $CC --version | |
| $CXX --version | |
| echo "**Linker version:**" | |
| ld --version | |
| echo "**CMake version:**" | |
| cmake --version | |
| echo "**OTP version:**" | |
| cat $(dirname $(which erlc))/../releases/RELEASES || true | |
| - name: "Build: create build dir" | |
| run: mkdir build | |
| - name: "Build: run cmake" | |
| working-directory: build | |
| run: | | |
| cmake .. | |
| # git clone will use more recent timestamps than cached beam files | |
| # touch them so we can benefit from the cache and avoid costly beam file rebuild. | |
| find . -name '*.beam' -exec touch {} \; | |
| - name: "Build erlang and Elixir libs" | |
| working-directory: build/libs | |
| run: | | |
| make | |
| - name: "Set SOC target" | |
| run: echo "SOC_TARGET=${{ startsWith(matrix.soc, 'esp32p4') && 'esp32p4' || matrix.soc }}" >> $GITHUB_ENV | |
| - name: "Use release defaults" | |
| if: startsWith(github.ref, 'refs/tags/') | |
| shell: bash | |
| working-directory: ./src/platforms/esp32/ | |
| run: | | |
| cp sdkconfig.release-defaults.in sdkconfig.defaults.in | |
| - name: "Handle esp32p4 variants sdkconfig" | |
| if: startsWith(matrix.soc, 'esp32p4') && matrix.soc != 'esp32p4' | |
| shell: bash | |
| working-directory: ./src/platforms/esp32/ | |
| run: | | |
| cp sdkconfig.defaults.${{ matrix.soc }} sdkconfig.defaults.esp32p4 | |
| - name: "Handle esp32p4 c6 variants - add wifi_remote component" | |
| if: matrix.soc == 'esp32p4_c6' || matrix.soc == 'esp32p4_pre_c6' | |
| shell: bash | |
| working-directory: ./src/platforms/esp32/components/avm_builtins | |
| run: | | |
| cp idf_component.yml.esp32p4_wifi_remote idf_component.yml | |
| - name: "Build ${{ matrix.soc }}${{ matrix.flavor }} with idf.py" | |
| shell: bash | |
| working-directory: ./src/platforms/esp32/ | |
| run: | | |
| rm -rf build | |
| . $IDF_PATH/export.sh | |
| if [ "${{ matrix.flavor }}" = "-elixir" ] | |
| then | |
| idf.py -DATOMVM_ELIXIR_SUPPORT=on set-target ${{ env.SOC_TARGET }} | |
| else | |
| idf.py -DATOMVM_ELIXIR_SUPPORT=off set-target ${{ env.SOC_TARGET }} | |
| fi | |
| idf.py reconfigure | |
| idf.py build | |
| - name: "Create a ${{ matrix.soc }}${{ matrix.flavor }} image" | |
| working-directory: ./src/platforms/esp32/build | |
| run: | | |
| ./mkimage.sh | |
| if [ "${{ matrix.soc }}" != "${{ env.SOC_TARGET }}" ]; then | |
| mv atomvm-${{ env.SOC_TARGET }}${{ matrix.flavor }}.img atomvm-${{ matrix.soc }}${{ matrix.flavor }}.img | |
| fi | |
| ls -l *.img | |
| - name: "Upload ${{ matrix.soc }} artifacts" | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: atomvm-${{ matrix.soc }}${{ matrix.flavor }}-image | |
| path: ./src/platforms/esp32/build/atomvm-${{ matrix.soc }}${{ matrix.flavor }}.img | |
| if-no-files-found: error | |
| - name: "Rename and write sha256sum" | |
| if: startsWith(github.ref, 'refs/tags/') | |
| shell: bash | |
| working-directory: src/platforms/esp32/build | |
| run: | | |
| ATOMVM_IMG="AtomVM-${{ matrix.soc }}${{ matrix.flavor }}-${{ github.ref_name }}.img" | |
| mv atomvm-${{ matrix.soc }}${{ matrix.flavor }}.img "${ATOMVM_IMG}" | |
| sha256sum "${ATOMVM_IMG}" > "${ATOMVM_IMG}.sha256" | |
| - name: Release | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| draft: true | |
| fail_on_unmatched_files: true | |
| files: | | |
| src/platforms/esp32/build/AtomVM-${{ matrix.soc }}${{ matrix.flavor }}-${{ github.ref_name }}.img | |
| src/platforms/esp32/build/AtomVM-${{ matrix.soc }}${{ matrix.flavor }}-${{ github.ref_name }}.img.sha256 |