Merge pull request #2268 from pguyot/w16/renode-1.16.1 #6477
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 Paul Guyot <pguyot@kallisys.net> | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later | |
| # | |
| name: Run tests with BEAM | |
| 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: | |
| run-tests: | |
| runs-on: ${{ matrix.os }} | |
| container: ${{ matrix.container }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: "ubuntu-24.04" | |
| test_erlang_opts: "-s prime_smp" | |
| otp: "26" | |
| container: erlang:26 | |
| - os: "ubuntu-24.04" | |
| test_erlang_opts: "-s prime_smp" | |
| otp: "27" | |
| container: erlang:27 | |
| - os: "ubuntu-24.04" | |
| test_erlang_opts: "-s prime_smp" | |
| otp: "28" | |
| container: erlang:28 | |
| - os: "ubuntu-24.04" | |
| test_erlang_opts: "-s prime_smp" | |
| otp: "29" | |
| container: erlang:29 | |
| # This is ARM64 | |
| - os: "macos-15" | |
| otp: "26" | |
| - os: "macos-15" | |
| otp: "27" | |
| - os: "macos-15" | |
| otp: "28" | |
| steps: | |
| # Setup | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - name: "Git config safe.directory" | |
| if: matrix.container | |
| run: git config --global --add safe.directory /__w/AtomVM/AtomVM | |
| - name: "Switch to archive.debian.org" | |
| if: matrix.archive == 'true' | |
| run: | | |
| sed -i 's|deb\.debian\.org|archive.debian.org/debian-archive|g' /etc/apt/sources.list | |
| - name: "Install deps (container)" | |
| if: runner.os == 'Linux' | |
| run: | | |
| apt update -y | |
| apt install -y cmake gperf zlib1g-dev ninja-build | |
| - name: "Normalize ImageOS for setup-beam" | |
| if: matrix.os == 'macos-26' | |
| run: echo "ImageOS=macos15" >> "$GITHUB_ENV" | |
| - uses: erlef/setup-beam@v1 | |
| if: runner.os == 'macOS' | |
| with: | |
| otp-version: ${{ matrix.otp }} | |
| rebar3-version: ${{ fromJSON('{"26":"3.25.1","27":"3.25.1","28":"3.26"}')[matrix.otp] || '3' }} | |
| hexpm-mirrors: | | |
| https://builds.hex.pm | |
| https://repo.hex.pm | |
| https://cdn.jsdelivr.net/hex | |
| - name: "Install deps (macOS)" | |
| if: runner.os == 'macOS' | |
| run: brew update && HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install gperf mbedtls@3 | |
| - name: "macOS setup mbedtls@3 environment" | |
| if: runner.os == 'macOS' | |
| 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 | |
| # Build | |
| - name: "Build: create build dir" | |
| run: mkdir build | |
| - uses: actions/cache@v4 | |
| id: cache | |
| with: | |
| path: 'build/tests/**/*.beam' | |
| key: ${{ matrix.otp }}-${{ hashFiles('**/run-tests-with-beam.yaml', 'tests/**/*.erl') }} | |
| - name: "Build: run cmake" | |
| working-directory: build | |
| run: | | |
| cmake -G Ninja ${MBEDTLS_PREFIX:+-DCMAKE_PREFIX_PATH="$MBEDTLS_PREFIX"} ${{ matrix.cmake_opts }} .. | |
| - name: "Touch files to benefit from cache" | |
| working-directory: build | |
| run: | | |
| # 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: run ninja" | |
| working-directory: build | |
| run: | | |
| ninja | |
| # Test | |
| - name: "Test: test-erlang with BEAM" | |
| timeout-minutes: 10 | |
| working-directory: build | |
| run: | | |
| ./tests/test-erlang -b ${{ matrix.test_erlang_opts }} | |
| # Test | |
| - name: "Test: estdlib/ with BEAM" | |
| timeout-minutes: 10 | |
| working-directory: build | |
| run: | | |
| erl -pa tests/libs/estdlib/ -pa tests/libs/estdlib/beams/ -pa tests/libs/estdlib/beam_beams/ -pa libs/etest/src/beams -pa libs/eavmlib/src/beams -pa libs/avm_network/src/beams -s tests -s init stop -noshell | |
| # Test | |
| - name: "Run tests/libs/etest/test_eunit with OTP eunit" | |
| timeout-minutes: 10 | |
| working-directory: build | |
| run: | | |
| erl -pa tests/libs/etest/beams -s test_eunit test -s init stop -noshell | |
| # Test | |
| - name: "Test: jit/ with BEAM" | |
| timeout-minutes: 10 | |
| working-directory: build | |
| if: matrix.otp != '21' && matrix.otp != '22' | |
| run: | | |
| erl -pa tests/libs/jit/beams/ libs/jit/src/beams/ libs/etest/src/beams -noshell -s tests -s init stop -noshell |