From 9636b3b5a99d570c7829d0efedc184b67bd41889 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 18:22:41 +0000 Subject: [PATCH 1/2] ci: update github actions to run tests on latest stable nim version - Added 'stable' to the Nim version matrix in `tests.yml`. - Updated `nim-version` to `stable` in `docs.yml`. - Updated `actions/checkout` and `actions/cache` to `v4`. - Updated `jiro4989/setup-nim-action` to `v2` to avoid node12/16 deprecation warnings. Co-authored-by: gabbhack <43146729+gabbhack@users.noreply.github.com> --- .github/workflows/docs.yml | 6 +++--- .github/workflows/tests.yml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0270d66..1af6640 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,12 +13,12 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Nim - uses: jiro4989/setup-nim-action@v1 + uses: jiro4989/setup-nim-action@v2 with: - nim-version: 1.6.12 + nim-version: stable - name: Build docs run: nimble docs diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 515bd21..0e1d40b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,22 +18,22 @@ jobs: if: "github.event.pull_request.draft == false && ! contains(toJSON(github.event.commits.*.message), '[skip-ci]')" strategy: matrix: - nim: ['1.6.12', 'devel'] + nim: ['1.6.12', 'stable', 'devel'] os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Cache nimble id: cache-nimble - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.nimble key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }} if: runner.os != 'Windows' - name: Set up Nim - uses: jiro4989/setup-nim-action@v1 + uses: jiro4989/setup-nim-action@v2 with: nim-version: ${{ matrix.nim }} From f3e726b84fac9473997761ed972ce583205d0cb3 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 20:40:54 +0000 Subject: [PATCH 2/2] ci: use concrete version 2.2.8 and fix unreachables - Updated github actions workflow to test against a concrete latest Nim version 2.2.8 - Updated `fail-fast: false` to strategy matrix so that tests for versions run in parallel and independently - Fixed compilation error in `src/deser/des/helpers.nim` where dead code after `{.noreturn.}` functions triggered warnings on newer Nim versions Co-authored-by: gabbhack <43146729+gabbhack@users.noreply.github.com> --- .github/workflows/docs.yml | 2 +- .github/workflows/tests.yml | 3 ++- src/deser/des/helpers.nim | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1af6640..d95635d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Nim uses: jiro4989/setup-nim-action@v2 with: - nim-version: stable + nim-version: 2.2.8 - name: Build docs run: nimble docs diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0e1d40b..e2932fe 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,8 +17,9 @@ jobs: build: if: "github.event.pull_request.draft == false && ! contains(toJSON(github.event.commits.*.message), '[skip-ci]')" strategy: + fail-fast: false matrix: - nim: ['1.6.12', 'stable', 'devel'] + nim: ['1.6.12', '2.2.8', 'devel'] os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: diff --git a/src/deser/des/helpers.nim b/src/deser/des/helpers.nim index 5af7a96..6046882 100644 --- a/src/deser/des/helpers.nim +++ b/src/deser/des/helpers.nim @@ -299,51 +299,51 @@ Generate forward declarations and default implementation for [Visitor](#visitor) # default implementation proc visitBool[Self: selfType](self: Self, value: bool): self.Value = raiseInvalidType(initUnexpectedBool(value), self) - result = default(self.Value) + proc visitInt8[Self: selfType](self: Self, value: int8): self.Value = self.visitInt64(value.int64) proc visitInt16[Self: selfType](self: Self, value: int16): self.Value = self.visitInt64(value.int64) proc visitInt32[Self: selfType](self: Self, value: int32): self.Value = self.visitInt64(value.int64) proc visitInt64[Self: selfType](self: Self, value: int64): self.Value = raiseInvalidType(initUnexpectedSigned(value), self) - result = default(self.Value) + proc visitUint8[Self: selfType](self: Self, value: uint8): self.Value = self.visitUint64(value.uint64) proc visitUint16[Self: selfType](self: Self, value: uint16): self.Value = self.visitUint64(value.uint64) proc visitUint32[Self: selfType](self: Self, value: uint32): self.Value = self.visitUint64(value.uint64) proc visitUint64[Self: selfType](self: Self, value: uint64): self.Value = raiseInvalidType(initUnexpectedUnsigned(value), self) - result = default(self.Value) + proc visitFloat32[Self: selfType](self: Self, value: float32): self.Value = self.visitFloat64(value.float64) proc visitFloat64[Self: selfType](self: Self, value: float64): self.Value = raiseInvalidType(initUnexpectedFloat(value), self) - result = default(self.Value) + proc visitChar[Self: selfType](self: Self, value: char): self.Value = self.visitString($value) proc visitString[Self: selfType](self: Self, value: sink string): self.Value = raiseInvalidType(initUnexpectedString(value), self) - result = default(self.Value) + proc visitBytes[Self: selfType](self: Self, value: openArray[byte]): self.Value = raiseInvalidType(initUnexpectedBytes(@value), self) - result = default(self.Value) + proc visitNone[Self: selfType](self: Self): self.Value = raiseInvalidType(initUnexpectedOption(), self) - result = default(self.Value) + proc visitSome[Self: selfType](self: Self, deserializer: var auto): self.Value = raiseInvalidType(initUnexpectedOption(), self) - result = default(self.Value) + proc visitSeq[Self: selfType](self: Self, sequence: var auto): self.Value = raiseInvalidType(initUnexpectedSeq(), self) - result = default(self.Value) + proc visitMap[Self: selfType](self: Self, map: var auto): self.Value = raiseInvalidType(initUnexpectedMap(), self) - result = default(self.Value) + {.pop.}