Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
almirsarajcic committed Sep 17, 2024
1 parent 8a6d916 commit c59cc7f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 224 deletions.
9 changes: 7 additions & 2 deletions .github/github_workflows.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ defmodule GithubWorkflows do
@preview_app_name "#{@app_name_prefix}-#{@environment_name}"
@preview_app_host "#{@preview_app_name}.fly.dev"
@repo_name "phx_tools"
@shells ["bash", "zsh"]
# @shells ["bash", "zsh"]
@shells ["bash"]

def get do
%{
Expand Down Expand Up @@ -376,7 +377,7 @@ defmodule GithubWorkflows do
jobs ++
[
{:"test_linux_#{shell}", test_linux_script_job(shell)},
{:"test_macos_#{shell}", test_macos_script_job(shell)}
# {:"test_macos_#{shell}", test_macos_script_job(shell)}
]
end)
end
Expand Down Expand Up @@ -431,6 +432,10 @@ defmodule GithubWorkflows do
if: "steps.result_cache.outputs.cache-hit != 'true'",
run: expect_install_command
],
[
name: "Debug",
uses: "lhotari/action-upterm@v1"
],
[
name: "Test the script",
if: "steps.result_cache.outputs.cache-hit != 'true'",
Expand Down
113 changes: 2 additions & 111 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
- name: Install expect tool
if: steps.result_cache.outputs.cache-hit != 'true'
run: sudo apt-get update && sudo apt-get install -y expect
- name: Debug
uses: lhotari/action-upterm@v1
- name: Test the script
if: steps.result_cache.outputs.cache-hit != 'true'
run: cd test/scripts && expect script.exp Linux.sh
Expand All @@ -40,121 +42,10 @@ jobs:
max_attempts: 7
retry_wait_seconds: 5
timeout_seconds: 1
test_macos_bash:
name: Test macOS script with bash shell
runs-on: macos-latest
env:
SHELL: /bin/bash
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 }}-bash-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
shell: /bin/bash -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: /bin/bash -c 'source ~/.bashrc && SHELL=/bin/bash make -f test/scripts/Makefile serve'
shell: /bin/bash -l {0}
- 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
test_linux_zsh:
name: Test Linux script with zsh shell
runs-on: ubuntu-latest
env:
SHELL: /bin/zsh
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 }}-zsh-script-${{ hashFiles('test/scripts/script.exp') }}-${{ hashFiles('priv/static/Linux.sh') }}
path: priv/static/Linux.sh
- name: Install shell
if: steps.result_cache.outputs.cache-hit != 'true'
run: sudo apt-get update && sudo apt-get install -y zsh
- name: Install expect tool
if: steps.result_cache.outputs.cache-hit != 'true'
run: sudo apt-get update && sudo apt-get install -y expect
- name: Test the script
if: steps.result_cache.outputs.cache-hit != 'true'
run: cd test/scripts && expect script.exp Linux.sh
shell: /bin/zsh -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: /bin/zsh -c 'source ~/.zshrc && SHELL=/bin/zsh make -f test/scripts/Makefile serve'
shell: /bin/zsh -l {0}
- 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
test_macos_zsh:
name: Test macOS script with zsh shell
runs-on: macos-latest
env:
SHELL: /bin/zsh
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 }}-zsh-script-${{ hashFiles('test/scripts/script.exp') }}-${{ hashFiles('priv/static/macOS.sh') }}
path: priv/static/macOS.sh
- name: Install shell
if: steps.result_cache.outputs.cache-hit != 'true'
run: brew install zsh
- 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
shell: /bin/zsh -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: /bin/zsh -c 'source ~/.zshrc && SHELL=/bin/zsh make -f test/scripts/Makefile serve'
shell: /bin/zsh -l {0}
- 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_bash
- test_macos_bash
- test_linux_zsh
- test_macos_zsh
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
113 changes: 2 additions & 111 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
- name: Install expect tool
if: steps.result_cache.outputs.cache-hit != 'true'
run: sudo apt-get update && sudo apt-get install -y expect
- name: Debug
uses: lhotari/action-upterm@v1
- name: Test the script
if: steps.result_cache.outputs.cache-hit != 'true'
run: cd test/scripts && expect script.exp Linux.sh
Expand All @@ -44,121 +46,10 @@ jobs:
max_attempts: 7
retry_wait_seconds: 5
timeout_seconds: 1
test_macos_bash:
name: Test macOS script with bash shell
runs-on: macos-latest
env:
SHELL: /bin/bash
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 }}-bash-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
shell: /bin/bash -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: /bin/bash -c 'source ~/.bashrc && SHELL=/bin/bash make -f test/scripts/Makefile serve'
shell: /bin/bash -l {0}
- 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
test_linux_zsh:
name: Test Linux script with zsh shell
runs-on: ubuntu-latest
env:
SHELL: /bin/zsh
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 }}-zsh-script-${{ hashFiles('test/scripts/script.exp') }}-${{ hashFiles('priv/static/Linux.sh') }}
path: priv/static/Linux.sh
- name: Install shell
if: steps.result_cache.outputs.cache-hit != 'true'
run: sudo apt-get update && sudo apt-get install -y zsh
- name: Install expect tool
if: steps.result_cache.outputs.cache-hit != 'true'
run: sudo apt-get update && sudo apt-get install -y expect
- name: Test the script
if: steps.result_cache.outputs.cache-hit != 'true'
run: cd test/scripts && expect script.exp Linux.sh
shell: /bin/zsh -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: /bin/zsh -c 'source ~/.zshrc && SHELL=/bin/zsh make -f test/scripts/Makefile serve'
shell: /bin/zsh -l {0}
- 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
test_macos_zsh:
name: Test macOS script with zsh shell
runs-on: macos-latest
env:
SHELL: /bin/zsh
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 }}-zsh-script-${{ hashFiles('test/scripts/script.exp') }}-${{ hashFiles('priv/static/macOS.sh') }}
path: priv/static/macOS.sh
- name: Install shell
if: steps.result_cache.outputs.cache-hit != 'true'
run: brew install zsh
- 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
shell: /bin/zsh -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: /bin/zsh -c 'source ~/.zshrc && SHELL=/bin/zsh make -f test/scripts/Makefile serve'
shell: /bin/zsh -l {0}
- 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_bash
- test_macos_bash
- test_linux_zsh
- test_macos_zsh
runs-on: ubuntu-latest
permissions: write-all
concurrency:
Expand Down

0 comments on commit c59cc7f

Please sign in to comment.