Merge pull request #1878 from pguyot/w40/run-tests-on-aarch64-runner #5714
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: ["24", "25", "26", "27", "28"] | |
cmake_opts_other: [""] | |
include: | |
- os: "macos-15-intel" | |
otp: "28" | |
cmake_opts_other: "-DAVM_DISABLE_JIT=OFF" | |
- os: "macos-14" | |
otp: "28" | |
cmake_opts_other: "-DAVM_DISABLE_JIT=OFF" | |
- os: "macos-15" | |
otp: "28" | |
cmake_opts_other: "-DAVM_DISABLE_JIT=OFF" | |
steps: | |
# Setup | |
- name: "Checkout repo" | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: "Install deps" | |
if: matrix.otp != '24' && matrix.otp != '25' | |
run: brew update && HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install gperf doxygen erlang@${{ matrix.otp }} gleam mbedtls rebar3 | |
- name: "Install deps" | |
if: matrix.otp == '24' || matrix.otp == '25' | |
run: | | |
brew update | |
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install gperf doxygen erlang@${{ matrix.otp }} gleam mbedtls | |
wget https://github.com/erlang/rebar3/releases/download/3.23.0/rebar3 | |
chmod +x rebar3 | |
for bin_dir in {/usr/local,/opt/homebrew}/opt/erlang@{24,25}/bin/ ; do | |
if [ -e ${bin_dir} ]; then | |
sudo cp rebar3 ${bin_dir} | |
fi | |
done | |
- 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 | |
# 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: | | |
export PATH="/usr/local/opt/erlang@${{ matrix.otp }}/bin:/opt/homebrew/opt/erlang@${{ matrix.otp }}/bin:$PATH" | |
cmake -DAVM_WARNINGS_ARE_ERRORS=ON ${{ matrix.cmake_opts_other }} -G Ninja .. | |
- name: "Build: run ninja" | |
working-directory: build | |
run: | | |
export PATH="/usr/local/opt/erlang@${{ matrix.otp }}/bin:/opt/homebrew/opt/erlang@${{ matrix.otp }}/bin:$PATH" | |
ninja | |
- name: "Build: run dialyzer" | |
working-directory: build | |
run: | | |
export PATH="/usr/local/opt/erlang@${{ matrix.otp }}/bin:/opt/homebrew/opt/erlang@${{ matrix.otp }}/bin:$PATH" | |
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: | | |
export PATH="/usr/local/opt/erlang@${{ matrix.otp }}/bin:/opt/homebrew/opt/erlang@${{ matrix.otp }}/bin:$PATH" | |
sudo ninja install | |
atomvm examples/erlang/hello_world.avm | |
atomvm -v | |
atomvm -h |