Skip to content

fix: disable compiler mode until nif_call fix" (#89) #132

fix: disable compiler mode until nif_call fix" (#89)

fix: disable compiler mode until nif_call fix" (#89) #132

Workflow file for this run

name: Test
on:
push:
branches:
- main
paths-ignore:
- '*.md'
- '**/*.md'
pull_request:
paths-ignore:
- '*.md'
- '**/*.md'
jobs:
linux:
name: ${{ matrix.job.arch }}-linux-gnu (${{ matrix.job.elixir }}, ${{ matrix.job.otp }})
runs-on: ${{ matrix.job.runs-os }}
strategy:
fail-fast: false
matrix:
job:
- { arch: "x86_64", runs-os: ubuntu-latest, otp: "25.3.2.15", elixir: "1.15.4" }
- { arch: "aarch64", runs-os: ubuntu-24.04-arm, otp: "25.3.2.15", elixir: "1.15.4" }
env:
MIX_ENV: test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Elixir and Erlang
id: setup
run: |
curl -fsSO https://elixir-lang.org/install.sh
sh install.sh elixir@${{ matrix.job.elixir }} otp@${{ matrix.job.otp }}
OTP_VERSION="${{ matrix.job.otp }}"
OTP_MAJOR="${OTP_VERSION%%.*}"
export OTP_PATH=$HOME/.elixir-install/installs/otp/${OTP_VERSION}/bin
export ELIXIR_PATH=$HOME/.elixir-install/installs/elixir/${{ matrix.job.elixir }}-otp-${OTP_MAJOR}/bin
echo "path=${OTP_PATH}:${ELIXIR_PATH}" >> $GITHUB_OUTPUT
echo "${OTP_PATH}" >> $GITHUB_PATH
echo "${ELIXIR_PATH}" >> $GITHUB_PATH
- name: Compile and check warnings
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
mix local.hex --force
mix local.rebar --force
mix deps.get
mix compile --warnings-as-errors
- name: Run epmd for distributed tests
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
epmd -daemon
- name: Run tests
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
if [ "${{ matrix.job.build }}" = "true" ]; then
export LIBMLX_BUILD=true
fi
mix test --warnings-as-errors
macos:
name: macOS (${{ matrix.job.elixir }}, ${{ matrix.job.otp }})
runs-on: macos-14
strategy:
fail-fast: false
matrix:
job:
- { otp: "25.3.2.15", elixir: "1.15.4" }
- { otp: "25.3.2.15", elixir: "1.16.2", lint: true }
- { otp: "25.3.2.15", elixir: "1.16.2", build: true }
- { otp: "25.3.2.15", elixir: "1.16.2", gpu: true }
- { otp: "25.3.2.15", elixir: "1.16.2", gpu: true, build: true }
env:
MIX_ENV: test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Elixir and Erlang
id: setup
run: |
curl -fsSO https://elixir-lang.org/install.sh
sh install.sh elixir@${{ matrix.job.elixir }} otp@${{ matrix.job.otp }}
OTP_VERSION="${{ matrix.job.otp }}"
OTP_MAJOR="${OTP_VERSION%%.*}"
export OTP_PATH=$HOME/.elixir-install/installs/otp/${OTP_VERSION}/bin
export ELIXIR_PATH=$HOME/.elixir-install/installs/elixir/${{ matrix.job.elixir }}-otp-${OTP_MAJOR}/bin
echo "path=${OTP_PATH}:${ELIXIR_PATH}" >> $GITHUB_OUTPUT
echo "${OTP_PATH}" >> $GITHUB_PATH
echo "${ELIXIR_PATH}" >> $GITHUB_PATH
- name: Setup Mix
run: |
mix local.hex --force
mix local.rebar --force
- name: Retrieve dependencies cache
env:
cache-name: cache-mix-deps
uses: actions/cache@v4
id: mix-cache # id to use in retrieve action
with:
path: ${{ github.workspace }}/deps
key: ${{ runner.os }}-Elixir-v${{ matrix.job.elixir }}-OTP-${{ matrix.job.otp }}-${{ hashFiles(format('{0}/mix.lock', github.workspace)) }}-v1
- name: Install dependencies
if: ${{ steps.mix-cache.outputs.cache-hit != 'true' }}
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
mix deps.get
- name: Compile and check warnings
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
if [ "${{ matrix.job.build }}" = "true" ]; then
export LIBMLX_BUILD=true
fi
mix compile --warnings-as-errors
- name: Check formatting
if: ${{ matrix.job.lint }}
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
if [ "${{ matrix.job.build }}" = "true" ]; then
export LIBMLX_BUILD=true
fi
mix format --check-formatted
- name: Run epmd for distributed tests
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
epmd -daemon
- name: Run tests
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
export EMLX_TEST_DEFAULT_GPU="${{ matrix.job.gpu }}"
if [ "${{ matrix.job.build }}" = "true" ]; then
export LIBMLX_BUILD=true
fi
if [ "${{ matrix.job.gpu }}" = "true" ]; then
find test -name "*_test.exs" -exec bash -c 'NAME={}; echo -e "\n\n----$NAME----\n"; mix test $NAME' \;
else
mix test --warnings-as-errors
fi