Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
rowah committed Sep 16, 2024
1 parent 4843832 commit 986a969
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 106 deletions.
2 changes: 1 addition & 1 deletion .github/github_workflows.ex
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ defmodule GithubWorkflows do
#sobelow: sobelow_job(),
#test: test_job(),
test_linux_script_job: test_linux_script_job(),
test_macos_script_job: test_macos_script_job(),
#test_macos_script_job: test_macos_script_job(),
#unused_deps: unused_deps_job()
]
end
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,43 +38,10 @@ jobs:
max_attempts: 7
retry_wait_seconds: 5
timeout_seconds: 1
test_macos_script_job:
name: Test macOS script
runs-on: macos-latest
env:
TZ: America/New_York
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore script result cache
uses: actions/cache@v3
id: result_cache
with:
key: ${{ runner.os }}-script-${{ hashFiles('test/scripts/script.exp') }}-${{ hashFiles('priv/static/macOS.sh') }}
path: priv/static/macOS.sh
- name: Install expect tool
if: steps.result_cache.outputs.cache-hit != 'true'
run: brew install expect
- name: Test the script
if: steps.result_cache.outputs.cache-hit != 'true'
run: cd test/scripts && expect script.exp macOS.sh
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: source ~/.bashrc && make -f test/scripts/Makefile
shell: bash
- name: Check HTTP status code
if: steps.result_cache.outputs.cache-hit != 'true'
uses: nick-fields/retry@v2
with:
command: INPUT_SITES='["http://localhost:4000"]' INPUT_EXPECTED='[200]' ./test/scripts/check_status_code.sh
max_attempts: 7
retry_wait_seconds: 5
timeout_seconds: 1
deploy_production_app:
name: Deploy production app
needs:
- test_linux_script_job
- test_macos_script_job
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,43 +42,10 @@ jobs:
max_attempts: 7
retry_wait_seconds: 5
timeout_seconds: 1
test_macos_script_job:
name: Test macOS script
runs-on: macos-latest
env:
TZ: America/New_York
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore script result cache
uses: actions/cache@v3
id: result_cache
with:
key: ${{ runner.os }}-script-${{ hashFiles('test/scripts/script.exp') }}-${{ hashFiles('priv/static/macOS.sh') }}
path: priv/static/macOS.sh
- name: Install expect tool
if: steps.result_cache.outputs.cache-hit != 'true'
run: brew install expect
- name: Test the script
if: steps.result_cache.outputs.cache-hit != 'true'
run: cd test/scripts && expect script.exp macOS.sh
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: source ~/.bashrc && make -f test/scripts/Makefile
shell: bash
- name: Check HTTP status code
if: steps.result_cache.outputs.cache-hit != 'true'
uses: nick-fields/retry@v2
with:
command: INPUT_SITES='["http://localhost:4000"]' INPUT_EXPECTED='[200]' ./test/scripts/check_status_code.sh
max_attempts: 7
retry_wait_seconds: 5
timeout_seconds: 1
deploy_preview_app:
name: Deploy preview app
needs:
- test_linux_script_job
- test_macos_script_job
runs-on: ubuntu-latest
permissions: write-all
concurrency:
Expand Down
63 changes: 24 additions & 39 deletions priv/static/Linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ function already_installed() {
"Git")
which git >/dev/null 2>&1
;;
"Zsh")
which zsh >/dev/null 2>&1
;;
"wget")
dpkg -l | grep -q wget
;;
Expand Down Expand Up @@ -87,9 +84,6 @@ function install() {
"Git")
sudo apt-get install -y git
;;
"Zsh")
sudo apt-get install -y zsh
;;
"wget")
sudo apt-get install -y wget
;;
Expand Down Expand Up @@ -135,9 +129,6 @@ function install() {
echo 'pg_ctl() { "$HOME/.asdf/shims/pg_ctl" "$@"; }' >>$config_file
source $config_file >/dev/null 2>&1

# test posgres installation and startup
initdb -D ~/pgdata -U postgres
pg_ctl start -D ~/pgdata
;;
*)
echo "Invalid name argument on install"
Expand All @@ -159,35 +150,30 @@ function maybe_install() {
}

function add_env() {
echo ""
echo -e "${white}"
sleep 2
maybe_install "Git"
# echo ""
# echo -e "${white}"
# sleep 2
# maybe_install "Git"

echo ""
echo -e "${white}"
sleep 2
maybe_install "Zsh"
# echo -e "${white}"
# sleep 2
# maybe_install "wget"

echo -e "${white}"
sleep 2
maybe_install "wget"
# echo -e "${white}"
# sleep 3
# maybe_install "asdf"

echo -e "${white}"
sleep 3
maybe_install "asdf"
# 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 "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
Expand Down Expand Up @@ -246,12 +232,11 @@ echo -e "${bblue}${bold}The following will be installed if not available already
echo -e "${cyan}${bold}"

echo "1) Build dependencies"
echo "2) Zsh"
echo "3) asdf"
echo "4) Erlang"
echo "5) Elixir"
echo "6) Phoenix"
echo "7) PostgreSQL"
echo "2) asdf"
echo "3) Erlang"
echo "4) Elixir"
echo "5) Phoenix"
echo "6) PostgreSQL"

echo ""
echo -e "${white} ${bold}"
Expand Down

0 comments on commit 986a969

Please sign in to comment.