Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-latest
pair:
elixir: "1.16"
otp: "26"
- os: ubuntu-latest
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-latest
pair:
elixir: "1.20"
otp: "29"
- os: windows-latest
pair:
elixir: "1.20"
otp: "29"
steps:
- uses: actions/checkout@v6

Expand All @@ -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

Expand Down
12 changes: 8 additions & 4 deletions test/rustler_precompiled_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the other change is to adjust for Windows targets.


file_path = Path.join(tmp_dir, "poem.txt")
:ok = File.write(file_path, content)
Expand Down Expand Up @@ -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 ->

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise fails depending on order of execution.

:code.delete(RustlerPrecompilationExample.Native)
:code.purge(RustlerPrecompilationExample.Native)
end)

in_tmp(tmp_dir, fn ->
File.write!("checksum-Elixir.RustlerPrecompilationExample.Native.exs", checksum_sample)

Expand Down
Loading