Skip to content

Commit

Permalink
Fix CI and bugs for Erlang 27 and Elixir 1.17 (#1926)
Browse files Browse the repository at this point in the history
* Fix Erlang testcases to work with final Erlang 27 release

If there are no doc attributes the doc chunk will not be emitted, so we need to add it to tests that don't have any.

* Update CI to test/release with Erlang 27 and Elixir 1.17

* Ignore ... when autolinking spec

closes #1925
  • Loading branch information
garazdawi committed Jun 20, 2024
1 parent 7018022 commit 3f0c4a9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ jobs:
fail-fast: false
matrix:
include:
- pair:
- pair: # Test very old elixir and Erlang
elixir: "1.13"
otp: "22"
- pair:
- pair: # Test Erlang without -doc attribute support
elixir: "1.16"
otp: "26"
- pair: # Test Erlang with -doc attribute support
elixir: "1.17"
otp: "27"
lint: lint
steps:
- uses: actions/checkout@v3
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ jobs:
fail-fast: true
matrix:
include:
- otp: 24
otp_version: "24.0"
- otp: 25
otp_version: "25.0.4"
otp_version: "25.3.2.12"
elixir_version: "1.16.2"
- otp: 26
otp_version: "26.0.2"
otp_version: "26.2.5"
elixir_version: "1.16.2"
- otp: 27
otp_version: "27.0"
elixir_version: "1.17.0"

runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -44,6 +48,7 @@ jobs:
with:
otp_version: ${{ matrix.otp_version }}
otp: ${{ matrix.otp }}
elixir_version: ${{ matrix.elixir_version }}

- name: Upload Pre-built
env:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release_pre_built/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ inputs:
description: "The major OTP version"
otp_version:
description: "The exact OTP version (major.minor[.patch])"
elixir_version:
description: "The exact Elixir version (major.minor[.patch])"
runs:
using: "composite"
steps:
- uses: erlef/setup-beam@v1.16.0
with:
otp-version: ${{ inputs.otp_version }}
elixir-version: "1.16.0"
elixir-version: ${{ inputs.elixir_version }}
- name: Build ex_doc
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion lib/ex_doc/language/erlang.ex
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ defmodule ExDoc.Language.Erlang do
name == :record and acc != [] ->
{ast, acc}

name in [:"::", :when, :%{}, :{}, :|, :->] ->
name in [:"::", :when, :%{}, :{}, :|, :->, :...] ->
{ast, acc}

# %{required(...) => ..., optional(...) => ...}
Expand Down
3 changes: 3 additions & 0 deletions test/ex_doc/retriever/erlang_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ defmodule ExDoc.Retriever.ErlangTest do
test "module with no docs is generated", c do
erlc(c, :mod, ~S"""
-module(mod).
-moduledoc("").
""")

assert {[_], []} = Retriever.docs_from_modules([:mod], %ExDoc.Config{})
Expand Down Expand Up @@ -217,6 +218,7 @@ defmodule ExDoc.Retriever.ErlangTest do
erlc(c, :mod, ~S"""
-module(mod).
-export([f/0]).
-moduledoc("").
f() -> ok.
""")
Expand Down Expand Up @@ -319,6 +321,7 @@ defmodule ExDoc.Retriever.ErlangTest do
erlc(c, :mod, ~s"""
-module(mod).
-export([function/0]).
-moduledoc("").
-record(a, { a = 1 :: pos_integer(),
b :: non_neg_integer(),
Expand Down

0 comments on commit 3f0c4a9

Please sign in to comment.