Skip to content
Open
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
28 changes: 28 additions & 0 deletions .github/matrix.json
Original file line number Diff line number Diff line change
@@ -1,111 +1,139 @@
{
"include": [
{
"os": "ubuntu-latest",
"otp": "28",
"elixir": "1.19",
"project": "engine"
},
{
"os": "ubuntu-latest",
"otp": "28",
"elixir": "1.18.4",
"project": "engine"
},
{
"os": "ubuntu-latest",
"otp": "27",
"elixir": "1.18",
"project": "engine"
},
{
"os": "ubuntu-latest",
"otp": "26",
"elixir": "1.18",
"project": "engine"
},
{
"os": "ubuntu-latest",
"otp": "27",
"elixir": "1.17",
"project": "engine"
},
{
"os": "ubuntu-latest",
"otp": "26",
"elixir": "1.17",
"project": "engine"
},
{
"os": "ubuntu-latest",
"otp": "26",
"elixir": "1.16",
"project": "engine"
},
{
"os": "ubuntu-latest",
"otp": "28",
"elixir": "1.19",
"project": "expert_credo"
},
{
"os": "ubuntu-latest",
"otp": "28",
"elixir": "1.18.4",
"project": "expert_credo"
},
{
"os": "ubuntu-latest",
"otp": "27",
"elixir": "1.18",
"project": "expert_credo"
},
{
"os": "ubuntu-latest",
"otp": "26",
"elixir": "1.18",
"project": "expert_credo"
},
{
"os": "ubuntu-latest",
"otp": "27",
"elixir": "1.17",
"project": "expert_credo"
},
{
"os": "ubuntu-latest",
"otp": "26",
"elixir": "1.17",
"project": "expert_credo"
},
{
"os": "ubuntu-latest",
"otp": "26",
"elixir": "1.16",
"project": "expert_credo"
},
{
"os": "ubuntu-latest",
"otp": "28",
"elixir": "1.19",
"project": "forge"
},
{
"os": "ubuntu-latest",
"otp": "28",
"elixir": "1.18.4",
"project": "forge"
},
{
"os": "ubuntu-latest",
"otp": "27",
"elixir": "1.18",
"project": "forge"
},
{
"os": "ubuntu-latest",
"otp": "26",
"elixir": "1.18",
"project": "forge"
},
{
"os": "ubuntu-latest",
"otp": "27",
"elixir": "1.17",
"project": "forge"
},
{
"os": "ubuntu-latest",
"otp": "26",
"elixir": "1.17",
"project": "forge"
},
{
"os": "ubuntu-latest",
"otp": "26",
"elixir": "1.16",
"project": "forge"
},
{
"os": "ubuntu-latest",
"otp": "27.3.4.1",
"elixir": "1.17.3",
"project": "expert"
},
{
"os": "windows-2022",
"otp": "27.3.4.1",
"elixir": "1.17.3",
"project": "expert"
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,15 @@ jobs:
run: echo "matrix=$(jq -c . < .github/matrix.json)" >> $GITHUB_OUTPUT

test:
runs-on: ubuntu-latest
name: Test ${{ matrix.project }} on OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
runs-on: ${{matrix.os}}
name: Test ${{ matrix.project }} on OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} / ${{matrix.os}}
needs: prep-matrix
strategy:
matrix: ${{ fromJson(needs.prep-matrix.outputs.matrix) }}
steps:
- name: Set git to use original line ending (Windows)
if: runner.os == 'Windows'
run: git config --global core.autocrlf false
- name: Checkout code
uses: actions/checkout@v6

Expand Down
2 changes: 1 addition & 1 deletion apps/engine/lib/engine/mix.tasks.deps.safe_compile.ex
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ unless Elixir.Features.compile_keeps_current_directory?() do
makefile_win? = makefile_win?(dep)

command =
case :os.type() do
case Forge.OS.type() do
{:win32, _} when makefile_win? ->
"nmake /F Makefile.win"

Expand Down
13 changes: 12 additions & 1 deletion apps/engine/lib/engine/module/loader.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,18 @@ defmodule Engine.Module.Loader do

state ->
result = Code.ensure_loaded(module_name)
{result, Map.put(state, module_name, result)}
# Note(doorgan): I'm not sure if it's just a timing issue, but on Windows it
# can sometimes take a little bit before this function returns {:module, name}
# so I figured not caching the error result here should work. This module is a
# cache and I think most of the time this is called the module will already
# have been loaded.
new_state =
case result do
{:module, ^module_name} -> Map.put(state, module_name, result)
_ -> state
end

{result, new_state}
end)
end

Expand Down
11 changes: 3 additions & 8 deletions apps/engine/lib/engine/search/indexer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ defmodule Engine.Search.Indexer do
with {:ok, contents} <- File.read(path),
{:ok, entries} <- Indexer.Source.index(path, contents) do
Enum.filter(entries, fn entry ->
if contained_in?(path, deps_dir) do
if Forge.Path.contains?(path, deps_dir) do
entry.subtype == :definition
else
true
Expand Down Expand Up @@ -185,20 +185,15 @@ defmodule Engine.Search.Indexer do
build_dir = build_dir()

[root_dir, "**", @indexable_extensions]
|> Path.join()
|> Path.wildcard()
|> Enum.reject(&contained_in?(&1, build_dir))
|> Forge.Path.glob()
|> Enum.reject(&Forge.Path.contains?(&1, build_dir))
end

# stat(path) is here for testing so it can be mocked
defp stat(path) do
File.stat(path)
end

defp contained_in?(file_path, possible_parent) do
String.starts_with?(file_path, possible_parent)
end

defp deps_dir do
case Engine.Mix.in_project(&Mix.Project.deps_path/0) do
{:ok, path} -> path
Expand Down
Loading
Loading