From 8193a83c2cabc1a9db01a0448cb60a66cc31fdcd Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Mon, 28 Sep 2026 18:29:42 -0400 Subject: [PATCH 1/3] chore(ci): add targets Linux ARM64, macOS ARM64/x86_64, Windows x86_64 --- .github/workflows/ci.yml | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8c93d0..22e6660 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,20 +8,39 @@ on: jobs: test: - runs-on: ubuntu-24.04 + name: Test (${{ matrix.os }}, Elixir ${{ matrix.pair.elixir }}, OTP ${{ matrix.pair.otp }}) + runs-on: ${{ matrix.os }} env: MIX_ENV: test strategy: fail-fast: false matrix: include: - - pair: - elixir: 1.16 - otp: 26 - - pair: + - os: ubuntu-24.04 + pair: + elixir: "1.16" + otp: "26" + - os: ubuntu-24.04 + pair: elixir: "1.20" - otp: 29 + otp: "29" lint: true + - os: ubuntu-24.04-arm + pair: + elixir: "1.20" + otp: "29" + - os: macos-15-intel + pair: + elixir: "1.20" + otp: "29" + - os: macos-15 + pair: + elixir: "1.20" + otp: "29" + - os: windows-2025 + pair: + elixir: "1.20" + otp: "29" steps: - uses: actions/checkout@v6 @@ -35,7 +54,7 @@ jobs: path: | deps _build - key: ${{ runner.os }}-mix-${{matrix.pair.elixir}}-${{matrix.pair.otp}}-${{ hashFiles('**/mix.lock') }} + key: ${{ matrix.os }}-${{ runner.arch }}-mix-${{matrix.pair.elixir}}-${{matrix.pair.otp}}-${{ hashFiles('**/mix.lock') }} - run: mix deps.get From 5799f32d1f85d36c49f5a23ae29e73eca0332e2d Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Mon, 28 Sep 2026 18:50:16 -0400 Subject: [PATCH 2/3] fix tests --- test/rustler_precompiled_test.exs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/rustler_precompiled_test.exs b/test/rustler_precompiled_test.exs index c777efb..2c32110 100644 --- a/test/rustler_precompiled_test.exs +++ b/test/rustler_precompiled_test.exs @@ -230,6 +230,7 @@ defmodule RustlerPrecompiledTest do - x86_64-unknown-linux-gnu - x86_64-unknown-linux-musl """ + |> String.replace("\r\n", "\n") |> String.trim() assert {:error, ^error_message} = RustlerPrecompiled.target(config, @available_targets) @@ -369,10 +370,7 @@ defmodule RustlerPrecompiledTest do @tag :tmp_dir test "check_integrity_from_map/3", %{tmp_dir: tmp_dir} do - content = """ - Roses are red - Violets are blue - """ + content = "Roses are red\nViolets are blue\n" file_path = Path.join(tmp_dir, "poem.txt") :ok = File.write(file_path, content) @@ -846,6 +844,12 @@ defmodule RustlerPrecompiledTest do checksum_sample = File.read!(Path.join(nif_fixtures_dir, "checksum-sample-file.exs")) Process.register(self(), :load_data_fun_test) + # Unload the NIF before other tests replace the shared library. + on_exit(fn -> + :code.delete(RustlerPrecompilationExample.Native) + :code.purge(RustlerPrecompilationExample.Native) + end) + in_tmp(tmp_dir, fn -> File.write!("checksum-Elixir.RustlerPrecompilationExample.Native.exs", checksum_sample) From 3a5f40b7213ec6e51db9fc4468ed5787036a0782 Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Mon, 28 Sep 2026 18:52:17 -0400 Subject: [PATCH 3/3] use -latest os --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22e6660..6f9df6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,11 +16,11 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-24.04 + - os: ubuntu-latest pair: elixir: "1.16" otp: "26" - - os: ubuntu-24.04 + - os: ubuntu-latest pair: elixir: "1.20" otp: "29" @@ -33,11 +33,11 @@ jobs: pair: elixir: "1.20" otp: "29" - - os: macos-15 + - os: macos-latest pair: elixir: "1.20" otp: "29" - - os: windows-2025 + - os: windows-latest pair: elixir: "1.20" otp: "29"