From 5c7814d487a35019ccff6593b722325a2c7fd0ed Mon Sep 17 00:00:00 2001 From: Vandern Rodrigues Date: Sat, 9 Aug 2025 18:48:30 +0100 Subject: [PATCH 01/13] add ci workflow --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..82f744a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: Elixir CI + +on: + pull_request: + branches: + - main + - dev + +jobs: + test: + name: Test + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - elixir: '1.7.0' + otp: '21.0' + + - elixir: '1.18.4' + otp: '28.0' + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup Elixir + uses: erlef/setup-beam@v1 + with: + elixir-version: ${{ matrix.elixir }} + otp-version: ${{ matrix.otp }} + + - name: Install Dependencies + run: mix deps.get + + - name: Run Tests + run: mix test From c8ad841916b3ad517f1a5c2c40c2a20d632ad3f3 Mon Sep 17 00:00:00 2001 From: Vandern Rodrigues Date: Sat, 9 Aug 2025 18:59:42 +0100 Subject: [PATCH 02/13] try windows runner for 1.7.0-OTP-21 --- .github/workflows/ci.yml | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82f744a..3e51b30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,18 +7,9 @@ on: - dev jobs: - test: - name: Test + test-latest: + name: Test (v1.18.4, OTP-28) runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - elixir: '1.7.0' - otp: '21.0' - - - elixir: '1.18.4' - otp: '28.0' steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -26,8 +17,27 @@ jobs: - name: Setup Elixir uses: erlef/setup-beam@v1 with: - elixir-version: ${{ matrix.elixir }} - otp-version: ${{ matrix.otp }} + elixir-version: '1.18.4' + otp-version: '28.0' + + - name: Install Dependencies + run: mix deps.get + + - name: Run Tests + run: mix test + + test-oldest: + name: Test (v1.7.0, OTP-21) + runs-on: windows-2022 + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup Elixir + uses: erlef/setup-beam@v1 + with: + elixir-version: '1.7.0' + otp-version: '21.0' - name: Install Dependencies run: mix deps.get From 011f5c3c095462c38e7426f5d3ec98780b15b0c6 Mon Sep 17 00:00:00 2001 From: Vandern Rodrigues Date: Sat, 9 Aug 2025 19:08:50 +0100 Subject: [PATCH 03/13] try version-type: strict --- .github/workflows/ci.yml | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e51b30..7dc8302 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,28 +7,21 @@ on: - dev jobs: - test-latest: - name: Test (v1.18.4, OTP-28) - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Setup Elixir - uses: erlef/setup-beam@v1 - with: - elixir-version: '1.18.4' - otp-version: '28.0' - - - name: Install Dependencies - run: mix deps.get - - - name: Run Tests - run: mix test + test: + name: Test (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.otp }} on ${{ matrix.os }}) + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + include: + - elixir: '1.18.4' + otp: '28.0' + os: ubuntu-latest + - elixir: '1.7.0' + otp: '21.0' + os: windows-2022 - test-oldest: - name: Test (v1.7.0, OTP-21) - runs-on: windows-2022 steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -36,8 +29,9 @@ jobs: - name: Setup Elixir uses: erlef/setup-beam@v1 with: - elixir-version: '1.7.0' - otp-version: '21.0' + elixir-version: ${{ matrix.elixir }} + otp-version: ${{ matrix.otp }} + version-type: 'strict' - name: Install Dependencies run: mix deps.get From 1d21cc01f598ed3b029f040a8f53ef85d9bced46 Mon Sep 17 00:00:00 2001 From: Vandern Rodrigues Date: Sat, 9 Aug 2025 19:14:11 +0100 Subject: [PATCH 04/13] try otp-22 for windows runner --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7dc8302..a00fe07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: otp: '28.0' os: ubuntu-latest - elixir: '1.7.0' - otp: '21.0' + otp: '22.0' os: windows-2022 steps: From 811ae82ce2e814c4b06355de5a58ef8e786c1dbb Mon Sep 17 00:00:00 2001 From: Vandern Rodrigues Date: Sat, 9 Aug 2025 19:36:25 +0100 Subject: [PATCH 05/13] try raising lower end of test range to support streamdata --- .github/workflows/ci.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a00fe07..f404d45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,20 +8,16 @@ on: jobs: test: - name: Test (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.otp }} on ${{ matrix.os }}) - runs-on: ${{ matrix.os }} - + name: Test (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.otp }}) + runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - elixir: '1.18.4' otp: '28.0' - os: ubuntu-latest - - elixir: '1.7.0' - otp: '22.0' - os: windows-2022 - + - elixir: '1.12.0' + otp: '24.0' steps: - name: Checkout Repository uses: actions/checkout@v4 From 5f8d31fc3b34143d3a3c1b39592a141c7e92c83f Mon Sep 17 00:00:00 2001 From: Vandern Rodrigues Date: Sat, 9 Aug 2025 19:38:47 +0100 Subject: [PATCH 06/13] fix otp version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f404d45..88b32e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: - elixir: '1.18.4' otp: '28.0' - elixir: '1.12.0' - otp: '24.0' + otp: '24.3' steps: - name: Checkout Repository uses: actions/checkout@v4 From 42016a25eb0e69a633abc795c397393e43856835 Mon Sep 17 00:00:00 2001 From: Vandern Rodrigues Date: Sat, 9 Aug 2025 19:42:48 +0100 Subject: [PATCH 07/13] try relaxed version range for otp-24 --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88b32e6..54c804d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,8 +16,10 @@ jobs: include: - elixir: '1.18.4' otp: '28.0' + version-type: 'strict' - elixir: '1.12.0' - otp: '24.3' + otp: '24.x' + version-type: 'loose' steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -27,7 +29,7 @@ jobs: with: elixir-version: ${{ matrix.elixir }} otp-version: ${{ matrix.otp }} - version-type: 'strict' + version-type: ${{ matrix.version-type }} - name: Install Dependencies run: mix deps.get From 1ee208674df2cfe22cd69d8e8f5b7afc69dba7ae Mon Sep 17 00:00:00 2001 From: Vandern Rodrigues Date: Sat, 9 Aug 2025 19:50:45 +0100 Subject: [PATCH 08/13] try fix for failing test --- lib/msgpack/decoder.ex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/msgpack/decoder.ex b/lib/msgpack/decoder.ex index cf71b7a..d64e712 100644 --- a/lib/msgpack/decoder.ex +++ b/lib/msgpack/decoder.ex @@ -233,7 +233,9 @@ defmodule Msgpack.Decoder do base_datetime = NaiveDateTime.from_erl!(erlang_datetime) if nanoseconds > 0 do - NaiveDateTime.add(base_datetime, nanoseconds, :nanosecond) + # NaiveDateTime.add(base_datetime, nanoseconds, :nanosecond) + microseconds = div(nanoseconds, 1000) + %{base_datetime | microsecond: {microseconds, 6}} else base_datetime end @@ -250,7 +252,9 @@ defmodule Msgpack.Decoder do base_datetime = NaiveDateTime.from_erl!(erlang_datetime) if nanoseconds > 0 do - NaiveDateTime.add(base_datetime, nanoseconds, :nanosecond) + # NaiveDateTime.add(base_datetime, nanoseconds, :nanosecond) + microseconds = div(nanoseconds, 1000) + %{base_datetime | microsecond: {microseconds, 6}} else base_datetime end From 138a7eac41612897776e685fa4cab988330fbd65 Mon Sep 17 00:00:00 2001 From: Vandern Rodrigues Date: Sat, 9 Aug 2025 19:52:36 +0100 Subject: [PATCH 09/13] [skip ci] remove old code --- lib/msgpack/decoder.ex | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/msgpack/decoder.ex b/lib/msgpack/decoder.ex index d64e712..c76e037 100644 --- a/lib/msgpack/decoder.ex +++ b/lib/msgpack/decoder.ex @@ -233,7 +233,6 @@ defmodule Msgpack.Decoder do base_datetime = NaiveDateTime.from_erl!(erlang_datetime) if nanoseconds > 0 do - # NaiveDateTime.add(base_datetime, nanoseconds, :nanosecond) microseconds = div(nanoseconds, 1000) %{base_datetime | microsecond: {microseconds, 6}} else @@ -252,7 +251,6 @@ defmodule Msgpack.Decoder do base_datetime = NaiveDateTime.from_erl!(erlang_datetime) if nanoseconds > 0 do - # NaiveDateTime.add(base_datetime, nanoseconds, :nanosecond) microseconds = div(nanoseconds, 1000) %{base_datetime | microsecond: {microseconds, 6}} else From 89ed05ec175c1378ef783bcfabcef202bb15bf7a Mon Sep 17 00:00:00 2001 From: Vandern Rodrigues Date: Sat, 9 Aug 2025 19:58:14 +0100 Subject: [PATCH 10/13] bump minimum supported version --- mix.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index 161d5f8..acb56b7 100644 --- a/mix.exs +++ b/mix.exs @@ -8,7 +8,7 @@ defmodule MsgpackElixir.MixProject do [ app: :msgpack_elixir, version: @version, - elixir: "~> 1.7", + elixir: "~> 1.12", start_permanent: Mix.env() == :prod, deps: deps(), aliases: aliases(), From 23c0307934a28ffc36824ad7e7bf57dc0e80b79a Mon Sep 17 00:00:00 2001 From: Vandern Rodrigues Date: Sat, 9 Aug 2025 19:58:50 +0100 Subject: [PATCH 11/13] update min version in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d7bbdf..5253624 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ This section explains how to setup the project locally for development. ### Dependencies -- Elixir `~> 1.7` (OTP 21+) +- Elixir `~> 1.12` (OTP 24+) ### Get the Source From 32647debb3aa120b4aee5889bdec8a2330c3e2cd Mon Sep 17 00:00:00 2001 From: Vandern Rodrigues Date: Sat, 9 Aug 2025 19:59:07 +0100 Subject: [PATCH 12/13] update changelog --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4be9a25..d3b32ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added + +- Added CI workflow to run tests against supported Elixir versions + +### Changed + +- Updated minimum supported Elixir version to v1.12 + - While the library may work with older versions, StreamData supports a + minimum of v1.12, so it would be missing the property tests + +### Fixed + +- Updated timestamp decoding to be backwards-compatible with Elixir v1.12 + ## [v1.0.2] - 2025-08-06 ### Fixed From 0e2dd5bf93dd12536db8f2079e76900feb92f1f6 Mon Sep 17 00:00:00 2001 From: Vandern Rodrigues Date: Sat, 9 Aug 2025 20:03:29 +0100 Subject: [PATCH 13/13] add link to compat docs in readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 5253624..617bf21 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,9 @@ This section explains how to setup the project locally for development. ### Dependencies - Elixir `~> 1.12` (OTP 24+) + - See [Compatibility and + deprecations](https://hexdocs.pm/elixir/1.18.4/compatibility-and-deprecations.html) + for more information ### Get the Source