Skip to content

Commit

Permalink
Try again
Browse files Browse the repository at this point in the history
  • Loading branch information
almirsarajcic committed Sep 18, 2024
1 parent 5f341cb commit 00e92c1
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/github_workflows.ex
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ defmodule GithubWorkflows do
[
name: "Generate an app and start the server",
if: "steps.result_cache.outputs.cache-hit != 'true'",
run: "SHELL=/bin/#{shell} make -f test/scripts/Makefile serve",
run: "source #{config_file} && make -f test/scripts/Makefile serve",
shell: "/bin/#{shell} -l {0}"
],
[
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
shell: /bin/bash -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: SHELL=/bin/bash make -f test/scripts/Makefile serve
run: source ~/.bash_profile && make -f test/scripts/Makefile serve
shell: /bin/bash -l {0}
- name: Check HTTP status code
if: steps.result_cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
shell: /bin/bash -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: SHELL=/bin/bash make -f test/scripts/Makefile serve
run: source ~/.bash_profile && make -f test/scripts/Makefile serve
shell: /bin/bash -l {0}
- name: Check HTTP status code
if: steps.result_cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
shell: /bin/zsh -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: SHELL=/bin/zsh make -f test/scripts/Makefile serve
run: source ~/.zshrc && make -f test/scripts/Makefile serve
shell: /bin/zsh -l {0}
- name: Check HTTP status code
if: steps.result_cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
shell: /bin/zsh -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: SHELL=/bin/zsh make -f test/scripts/Makefile serve
run: source ~/.zshrc && make -f test/scripts/Makefile serve
shell: /bin/zsh -l {0}
- name: Check HTTP status code
if: steps.result_cache.outputs.cache-hit != 'true'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
shell: /bin/bash -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: SHELL=/bin/bash make -f test/scripts/Makefile serve
run: source ~/.bash_profile && make -f test/scripts/Makefile serve
shell: /bin/bash -l {0}
- name: Check HTTP status code
if: steps.result_cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
shell: /bin/bash -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: SHELL=/bin/bash make -f test/scripts/Makefile serve
run: source ~/.bash_profile && make -f test/scripts/Makefile serve
shell: /bin/bash -l {0}
- name: Check HTTP status code
if: steps.result_cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
shell: /bin/zsh -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: SHELL=/bin/zsh make -f test/scripts/Makefile serve
run: source ~/.zshrc && make -f test/scripts/Makefile serve
shell: /bin/zsh -l {0}
- name: Check HTTP status code
if: steps.result_cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
shell: /bin/zsh -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: SHELL=/bin/zsh make -f test/scripts/Makefile serve
run: source ~/.zshrc && make -f test/scripts/Makefile serve
shell: /bin/zsh -l {0}
- name: Check HTTP status code
if: steps.result_cache.outputs.cache-hit != 'true'
Expand Down
34 changes: 18 additions & 16 deletions priv/static/Linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ esac
function already_installed() {
case "$1" in
"Elixir")
mise which elixir >/dev/null 2>&1
which elixir >/dev/null 2>&1
;;
"Erlang")
mise which erl >/dev/null 2>&1
which erl >/dev/null 2>&1
;;
"mise")
which mise >/dev/null 2>&1
;;
"Phoenix")
mise exec mix phx.new --version >/dev/null 2>&1
mix phx.new --version >/dev/null 2>&1
;;
"PostgreSQL")
mise which initdb >/dev/null 2>&1
which initdb >/dev/null 2>&1
;;
*)
echo "Invalid name argument on checking: $1"
Expand All @@ -80,16 +80,18 @@ function install() {
case $current_shell in
"bash" | "rbash")
echo "eval \"\$(~/.local/bin/mise activate bash)\"" >>$config_file
eval "$(~/.local/bin/mise hook-env -s bash)"
;;
"zsh")
echo "eval \"\$(~/.local/bin/mise activate zsh)\"" >>$config_file
eval "$(~/.local/bin/mise hook-env -s zsh)"
;;
esac
;;
"Phoenix")
mise exec mix local.hex --force
mise exec mix local.rebar --force
mise exec mix archive.install --force hex phx_new $phoenix_version
mix local.hex --force
mix local.rebar --force
mix archive.install --force hex phx_new $phoenix_version
;;
"PostgreSQL")
sudo apt-get update
Expand Down Expand Up @@ -123,21 +125,21 @@ function add_env() {
sleep 1.5
maybe_install "mise"

echo -e "${white}"
sleep 1.5
maybe_install "Erlang"
# echo -e "${white}"
# sleep 1.5
# maybe_install "Erlang"

echo -e "${white}"
sleep 1.5
maybe_install "Elixir"

echo -e "${white}"
sleep 1.5
maybe_install "Phoenix"
# echo -e "${white}"
# sleep 1.5
# maybe_install "Phoenix"

echo -e "${white}"
sleep 1.5
maybe_install "PostgreSQL"
# echo -e "${white}"
# sleep 1.5
# maybe_install "PostgreSQL"

echo -e "${white}"
echo -e "${cyan}${bold}phx.tools setup is complete!"
Expand Down
48 changes: 25 additions & 23 deletions priv/static/macOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ esac
function already_installed() {
case "$1" in
"Elixir")
mise which elixir >/dev/null 2>&1
which elixir >/dev/null 2>&1
;;
"Erlang")
mise which erl >/dev/null 2>&1
which erl >/dev/null 2>&1
;;
"Homebrew")
which brew >/dev/null 2>&1
Expand All @@ -56,13 +56,13 @@ function already_installed() {
which mise >/dev/null 2>&1
;;
"Phoenix")
mise exec mix phx.new --version >/dev/null 2>&1
mix phx.new --version >/dev/null 2>&1
;;
"PostgreSQL")
mise which initdb >/dev/null 2>&1
which initdb >/dev/null 2>&1
;;
"Xcode Command Line Tools")
which xcode-select >/dev/null
which xcode-select >/dev/null 2>&1
;;
*)
echo "Invalid name argument on checking: $1"
Expand All @@ -89,16 +89,18 @@ function install() {
case $current_shell in
"bash" | "rbash")
echo "eval \"\$(~/.local/bin/mise activate bash)\"" >>$config_file
eval "$(~/.local/bin/mise hook-env -s bash)"
;;
"zsh")
echo "eval \"\$(~/.local/bin/mise activate zsh)\"" >>$config_file
eval "$(~/.local/bin/mise hook-env -s zsh)"
;;
esac
;;
"Phoenix")
mise exec mix local.hex --force
mise exec mix local.rebar --force
mise exec mix archive.install --force hex phx_new $phoenix_version
mix local.hex --force
mix local.rebar --force
mix archive.install --force hex phx_new $phoenix_version
;;
"PostgreSQL")
brew install gcc readline zlib curl ossp-uuid
Expand Down Expand Up @@ -130,33 +132,33 @@ function maybe_install() {
function add_env() {
echo ""

echo -e "${white}"
sleep 1.5
maybe_install "Xcode Command Line Tools"
# echo -e "${white}"
# sleep 1.5
# maybe_install "Xcode Command Line Tools"

echo -e "${white}"
sleep 1.5
maybe_install "Homebrew"
# echo -e "${white}"
# sleep 1.5
# maybe_install "Homebrew"

echo -e "${white}"
sleep 1.5
maybe_install "mise"

echo -e "${white}"
sleep 1.5
maybe_install "Erlang"
# echo -e "${white}"
# sleep 1.5
# maybe_install "Erlang"

echo -e "${white}"
sleep 1.5
maybe_install "Elixir"

echo -e "${white}"
sleep 1.5
maybe_install "Phoenix"
# echo -e "${white}"
# sleep 1.5
# maybe_install "Phoenix"

echo -e "${white}"
sleep 1.5
maybe_install "PostgreSQL"
# echo -e "${white}"
# sleep 1.5
# maybe_install "PostgreSQL"

echo -e "${white}"
echo -e "${cyan}${bold}phx.tools setup is complete!"
Expand Down
18 changes: 13 additions & 5 deletions test/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ SHELL := $(shell echo $$SHELL)
.SHELLFLAGS := -eu -c

serve:
mise exec initdb -D ~/pgdata -U postgres
mise exec pg_ctl start -D ~/pgdata
mise exec mix phx.new --no-install phx_tools_test
rm -f .tool-versions

@if [[ "$$SHELL" == *"bash"* ]]; then \
eval "$$(~/.local/bin/mise hook-env -s bash)"; \
elif [[ "$$SHELL" == *"zsh"* ]]; then \
eval "$$(~/.local/bin/mise hook-env -s zsh)"; \
fi

# initdb -D ~/pgdata -U postgres
# pg_ctl start -D ~/pgdata
mix phx.new --no-install phx_tools_test
cd phx_tools_test
mise exec mix setup
mise exec elixir --erl '-detached' -S mix phx.server
mix setup
elixir --erl '-detached' -S mix phx.server

0 comments on commit 00e92c1

Please sign in to comment.