Skip to content

Commit 7a57683

Browse files
author
Aleksei Matiushkin
committed
Update GHA
1 parent ef15564 commit 7a57683

File tree

3 files changed

+55
-17
lines changed

3 files changed

+55
-17
lines changed

.github/workflows/dialyzer.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,29 @@ name: Dialyzer
22

33
on:
44
schedule:
5-
- cron: "30 1 * * *"
5+
- cron: "30 1 * * *"
66

77
jobs:
88
test:
99
runs-on: ubuntu-latest
10-
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
10+
env:
11+
MIX_ENV: ci
12+
name: OTP ${{matrix.pair.otp}} / Elixir ${{matrix.pair.elixir}}
1113
strategy:
14+
fail-fast: false
1215
matrix:
13-
otp: [23.0]
14-
elixir: [1.10.1, 1.11.2]
16+
include:
17+
- pair:
18+
otp: 22.3
19+
elixir: 1.10.4
20+
- pair:
21+
otp: 23.2.5
22+
elixir: 1.11.3
1523
steps:
1624
- uses: actions/checkout@v2
17-
- uses: actions/setup-elixir@v1
25+
- uses: erlef/setup-elixir@v1
1826
with:
19-
otp-version: ${{matrix.otp}}
20-
elixir-version: ${{matrix.elixir}}
21-
- run: MIX_ENV=ci mix deps.get
22-
- run: MIX_ENV=ci mix quality.ci
27+
otp-version: ${{matrix.pair.otp}}
28+
elixir-version: ${{matrix.pair.elixir}}
29+
- run: mix deps.get
30+
- run: mix quality.ci

.github/workflows/test.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,24 @@ on: [push, pull_request]
55
jobs:
66
test:
77
runs-on: ubuntu-latest
8-
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
8+
env:
9+
MIX_ENV: test
10+
name: OTP ${{matrix.pair.otp}} / Elixir ${{matrix.pair.elixir}}
911
strategy:
12+
fail-fast: false
1013
matrix:
11-
otp: [23.0]
12-
elixir: [1.10.1, 1.11.2]
14+
include:
15+
- pair:
16+
otp: 22.3
17+
elixir: 1.10.1
18+
- pair:
19+
otp: 23.2.5
20+
elixir: 1.11.3
1321
steps:
1422
- uses: actions/checkout@v2
15-
- uses: actions/setup-elixir@v1
23+
- uses: erlef/setup-elixir@v1
1624
with:
17-
otp-version: ${{matrix.otp}}
18-
elixir-version: ${{matrix.elixir}}
19-
- run: MIX_ENV=ci mix deps.get
20-
- run: MIX_ENV=ci mix test
25+
otp-version: ${{matrix.pair.otp}}
26+
elixir-version: ${{matrix.pair.elixir}}
27+
- run: mix deps.get
28+
- run: mix test

lib/iteraptor/ast.ex

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@ defmodule Iteraptor.AST do
33
`Iteraptor.AST` module traverses AST, allowing `map`, `reduce` and family.
44
"""
55

6+
defp fill_struct(ast, env \\ Macro.escape(__ENV__))
7+
defp fill_struct({:%, _, [{:__aliases__, _, _} = aliases, {:%{}, _, data}]}, env) do
8+
quote do
9+
Kernel.struct!(Macro.struct!(unquote(aliases), unquote(env)), unquote(data))
10+
end
11+
end
12+
defp fill_struct(any, _), do: any
13+
14+
defp fill_destruct({:%, _, [{:__aliases__, _, _} = _aliases, {:%{}, meta, data}]}),
15+
do: {:%{}, meta, data} |> IO.inspect(label: "★★★")
16+
defp fill_destruct(any), do: any |> IO.inspect(label: "☆☆☆")
17+
18+
defmacro do_struct(input), do: fill_struct(input)
19+
defmacro do_destruct(input), do: IO.inspect(Macro.expand(input, __CALLER__))
20+
21+
defmacro destruct(input) do
22+
quote do
23+
att = unquote(input)
24+
Iteraptor.AST.do_destruct(att)
25+
end
26+
end
27+
628
@doc """
729
Mapper for the AST.
830

0 commit comments

Comments
 (0)