Skip to content
Merged
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
75 changes: 49 additions & 26 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,55 @@ jobs:
make compile.protocols.poncho
make dialyzer.all

release-test:
runs-on: ${{matrix.os.name}}
name: Release test (${{matrix.os.name}})
strategy:
matrix:
os:
- name: ubuntu-latest
target: linux_amd64
- name: macos-14
target: darwin_arm64
- name: macos-13
target: darwin_amd64

include:
- elixir: "1.15.8"
otp: "27"

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}

- uses: mlugg/setup-zig@v2
with:
version: "0.14.0"

- name: Cache deps
id: cache-deps
uses: actions/cache@v4
with:
path: |
apps/**/deps
apps/**/_build

key: ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('apps/**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-

- name: Build and release
env:
MIX_ENV: prod
BURRITO_TARGET: ${{ matrix.os.target }}
run: make build.engine && cd apps/expert && mix deps.get && mix release expert

test:
runs-on: ubuntu-latest
name: Test on OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
Expand Down Expand Up @@ -195,29 +244,3 @@ jobs:
# Step: Execute the tests.
- name: Run tests
run: make test.all

integration_test:
runs-on: ubuntu-latest
name: Integration tests
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build integration runner
uses: docker/build-push-action@v6
with:
context: .
file: ./integration/Dockerfile
tags: xp
# GitHub Actions cache
# https://docs.docker.com/build/ci/github-actions/cache/
cache-from: type=gha
cache-to: type=gha,mode=max
# Required to make the image available through docker
load: true

- name: Run integration tests
run: NO_BUILD=1 ./integration/test.sh
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ apps/forge/src/future_elixir_parser.erl

.DS_Store

# Ignore release artifacts
**/burrito_out

.notes/
48 changes: 46 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
poncho_dirs = forge expert_credo engine expert

local_target :=
ifeq ($(OS),Windows_NT)
local_target := $(local_target)windows
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
local_target := $(local_target)_amd64
endif
ifeq ($(PROCESSOR_ARCHITECTURE),x86)
local_target := $(local_target)_amd64
endif
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
local_target := $(local_target)linux
endif
ifeq ($(UNAME_S),Darwin)
local_target := $(local_target)darwin
endif
UNAME_P := $(shell uname -p)
ifeq ($(UNAME_P),x86_64)
local_target := $(local_target)_amd64
endif
ifneq ($(filter %86,$(UNAME_P)),)
local_target := $(local_target)_amd64
endif
ifneq ($(filter arm%,$(UNAME_P)),)
local_target := $(local_target)_arm64
endif
endif

compile.all: compile.poncho

dialyzer.all: compile.poncho dialyzer.poncho
Expand Down Expand Up @@ -41,5 +70,20 @@ dialyzer.plt.poncho:
dialyzer.poncho: compile.poncho compile.protocols.poncho
$(foreach dir, $(poncho_dirs), cd apps/$(dir) && mix dialyzer && cd ../..;)

package:
cd apps/expert && mix package
build.engine:
cd apps/engine && mix deps.get && MIX_ENV=dev mix build

release: build.engine
cd apps/expert &&\
mix deps.get &&\
EXPERT_RELEASE_MODE=burrito MIX_ENV=prod mix release expert --overwrite

release.local: build.engine
cd apps/expert &&\
mix deps.get &&\
EXPERT_RELEASE_MODE=burrito BURRITO_TARGET=$(local_target) MIX_ENV=prod mix release expert --overwrite

release.plain: build.engine
cd apps/expert &&\
mix deps.get &&\
EXPERT_RELEASE_MODE=plain MIX_ENV=prod mix release plain --overwrite
4 changes: 2 additions & 2 deletions apps/engine/lib/engine/engine/build/project.ex
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ defmodule Engine.Build.Project do
defp prepare_for_project_build(true = _initial?) do
if connected_to_internet?() do
with_progress "mix local.hex", fn ->
Mix.Task.run("local.hex", ~w(--force --if-missing))
Mix.Task.run("local.hex", ~w(--force))
end

with_progress "mix local.rebar", fn ->
Mix.Task.run("local.rebar", ~w(--force --if-missing))
Mix.Task.run("local.rebar", ~w(--force))
end

with_progress "mix deps.get", fn ->
Expand Down
Empty file removed apps/engine/priv/.gitkeep
Empty file.
100 changes: 0 additions & 100 deletions apps/expert/bin/activate_version_manager.sh

This file was deleted.

29 changes: 0 additions & 29 deletions apps/expert/bin/boot.exs

This file was deleted.

1 change: 0 additions & 1 deletion apps/expert/bin/debug_shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ node_name=$(epmd -names | grep manager-"$project_name" | awk '{print $2}')

iex --name "shell@127.0.0.1" \
--remsh "${node_name}" \
--dot-iex .iex.namespaced.exs \
--cookie expert
23 changes: 0 additions & 23 deletions apps/expert/bin/start_expert.sh

This file was deleted.

8 changes: 8 additions & 0 deletions apps/expert/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,12 @@ config :snowflake,
# First second of 2024
epoch: 1_704_070_800_000

case System.get_env("EXPERT_RELEASE_MODE", "plain") do
"burrito" ->
config :expert, arg_parser: {Burrito.Util.Args, :get_arguments, []}

"plain" ->
config :expert, arg_parser: {System, :argv, []}
end

import_config("#{config_env()}.exs")
Loading
Loading