Merge pull request #2268 from pguyot/w16/renode-1.16.1 #7170
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 2017-2022 Davide Bettio <davide@uninstall.it> | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later | |
| # | |
| name: Build and Test on macOS | |
| on: | |
| push: | |
| paths-ignore: | |
| - 'src/platforms/emscripten/**' | |
| - 'src/platforms/esp32/**' | |
| - 'src/platforms/rp2/**' | |
| - 'src/platforms/stm32/**' | |
| - 'doc/**' | |
| - 'LICENSES/**' | |
| - '*.Md' | |
| - '*.md' | |
| pull_request: | |
| paths-ignore: | |
| - 'src/platforms/emscripten/**' | |
| - 'src/platforms/esp32/**' | |
| - 'src/platforms/rp2/**' | |
| - 'src/platforms/stm32/**' | |
| - 'doc/**' | |
| - 'LICENSES/**' | |
| - '*.Md' | |
| - '*.md' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["macos-14", "macos-15", "macos-15-intel", "macos-26"] | |
| otp: ["26", "27", "28"] | |
| mbedtls: ["mbedtls@3"] | |
| cmake_opts_other: [""] | |
| include: | |
| - os: "macos-15-intel" | |
| otp: "28" | |
| mbedtls: "mbedtls@3" | |
| cmake_opts_other: "-DAVM_DISABLE_JIT=OFF" | |
| - os: "macos-14" | |
| otp: "28" | |
| mbedtls: "mbedtls@3" | |
| cmake_opts_other: "-DAVM_DISABLE_JIT=OFF" | |
| - os: "macos-15" | |
| otp: "28" | |
| mbedtls: "mbedtls@3" | |
| cmake_opts_other: "-DAVM_DISABLE_JIT=OFF" | |
| # JIT + DWARF build (macOS aarch64) | |
| - os: "macos-15" | |
| otp: "28" | |
| mbedtls: "mbedtls@3" | |
| cmake_opts_other: "-DAVM_DISABLE_JIT=OFF -DAVM_DISABLE_JIT_DWARF=OFF" | |
| steps: | |
| # Setup | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: ${{ matrix.otp }} | |
| rebar3-version: ${{ fromJSON('{"26":"3.25.1","27":"3.25.1","28":"3.26"}')[matrix.otp] || '3' }} | |
| gleam-version: "1.15.2" | |
| hexpm-mirrors: | | |
| https://builds.hex.pm | |
| https://repo.hex.pm | |
| https://cdn.jsdelivr.net/hex | |
| - name: "Install deps" | |
| run: brew update && HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install gperf doxygen socat ${{ matrix.mbedtls }} | |
| - name: "Workaround for nxdomain random issues" | |
| run: | | |
| # https://github.com/actions/runner-images/issues/8649#issuecomment-2231240347 | |
| for host in "$(hostname)" "$(hostname -f)"; do | |
| echo -e "$(ipconfig getifaddr en0) $(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts | |
| dscacheutil -q host -a name $(hostname -f) | |
| done | |
| - name: "Setup mbedtls@3 environment" | |
| if: matrix.mbedtls == 'mbedtls@3' | |
| run: | | |
| # Detect Homebrew prefix (Apple Silicon vs Intel) | |
| if [ -d "/opt/homebrew/opt/mbedtls@3" ]; then | |
| MBEDTLS_PREFIX="/opt/homebrew/opt/mbedtls@3" | |
| elif [ -d "/usr/local/opt/mbedtls@3" ]; then | |
| MBEDTLS_PREFIX="/usr/local/opt/mbedtls@3" | |
| else | |
| echo "Error: mbedtls@3 not found in expected locations" | |
| exit 1 | |
| fi | |
| echo "MBEDTLS_PREFIX=${MBEDTLS_PREFIX}" >> $GITHUB_ENV | |
| echo "LDFLAGS=-L${MBEDTLS_PREFIX}/lib" >> $GITHUB_ENV | |
| echo "CPPFLAGS=-I${MBEDTLS_PREFIX}/include" >> $GITHUB_ENV | |
| echo "PKG_CONFIG_PATH=${MBEDTLS_PREFIX}/lib/pkgconfig" >> $GITHUB_ENV | |
| # Builder info | |
| - name: "System info" | |
| run: | | |
| echo "**uname:**" | |
| uname -a | |
| echo "**C Compiler version:**" | |
| clang --version | |
| clang++ --version | |
| echo "**CMake version:**" | |
| cmake --version | |
| # Build | |
| - name: "Build: create build dir" | |
| run: mkdir build | |
| - name: "Build: run cmake" | |
| working-directory: build | |
| run: | | |
| cmake -DAVM_WARNINGS_ARE_ERRORS=ON ${MBEDTLS_PREFIX:+-DCMAKE_PREFIX_PATH="$MBEDTLS_PREFIX"} ${{ matrix.cmake_opts_other }} -G Ninja .. | |
| - name: "Build: run ninja" | |
| working-directory: build | |
| run: ninja | |
| - name: "Build: run dialyzer" | |
| working-directory: build | |
| run: ninja dialyzer | |
| # Test | |
| - name: "Test: test-erlang" | |
| timeout-minutes: 10 | |
| working-directory: build | |
| run: | | |
| ./tests/test-erlang | |
| - name: "Test: test-enif" | |
| working-directory: build | |
| run: | | |
| ./tests/test-enif | |
| - name: "Test: test-heap" | |
| working-directory: build | |
| run: | | |
| ./tests/test-heap | |
| - name: "Test: test-mailbox" | |
| working-directory: build | |
| run: | | |
| ./tests/test-mailbox | |
| - name: "Test: test-structs" | |
| timeout-minutes: 10 | |
| working-directory: build | |
| run: | | |
| ./tests/test-structs | |
| - name: "Test: test_etest.avm" | |
| timeout-minutes: 5 | |
| working-directory: build | |
| run: | | |
| ./src/AtomVM ./tests/libs/etest/test_etest.avm | |
| - name: "Test: test_estdlib.avm" | |
| timeout-minutes: 10 | |
| working-directory: build | |
| run: | | |
| ./src/AtomVM ./tests/libs/estdlib/test_estdlib.avm | |
| - name: "Test: test_eavmlib.avm" | |
| timeout-minutes: 10 | |
| working-directory: build | |
| run: | | |
| ./src/AtomVM ./tests/libs/eavmlib/test_eavmlib.avm | |
| - name: "Test: test_jit.avm" | |
| timeout-minutes: 10 | |
| working-directory: build | |
| run: | | |
| ./src/AtomVM tests/libs/jit/test_jit.avm | |
| - name: "Test: test_alisp.avm" | |
| timeout-minutes: 10 | |
| working-directory: build | |
| run: | | |
| ./src/AtomVM ./tests/libs/alisp/test_alisp.avm | |
| - name: "Install and smoke test" | |
| working-directory: build | |
| run: | | |
| sudo ninja install | |
| atomvm examples/erlang/hello_world.avm | |
| atomvm -v | |
| atomvm -h |