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 ef5cf5b commit 6f4fe10
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 20 deletions.
42 changes: 28 additions & 14 deletions .github/github_workflows.ex
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,26 @@ defmodule GithubWorkflows do
Enum.reduce(@shells, [], fn shell, jobs ->
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

defp test_shell_script_job(os, runs_on, shell, shell_install_command, expect_install_command) do
defp test_shell_script_job(opts) do
os = Keyword.fetch!(opts, :os)
runs_on = Keyword.fetch!(opts, :runs_on)
shell = Keyword.fetch!(opts, :shell)
shell_install_command = Keyword.fetch!(opts, :shell_install_command)
expect_install_command = Keyword.fetch!(opts, :expect_install_command)

config_file =
case shell do
"bash" -> "~/.bashrc"
"fish" -> "~/.config/fish/config.fish"
"zsh" -> "~/.zshrc"
end

[
name: "Test #{os} script with #{shell} shell",
"runs-on": runs_on,
Expand Down Expand Up @@ -427,7 +441,7 @@ defmodule GithubWorkflows do
[
name: "Generate an app and start the server",
if: "steps.result_cache.outputs.cache-hit != 'true'",
run: "make -f test/scripts/Makefile serve",
run: "source #{config_file} && make -f test/scripts/Makefile serve",
shell: "/bin/#{shell} -l {0}"
],
[
Expand All @@ -448,21 +462,21 @@ defmodule GithubWorkflows do

defp test_linux_script_job(shell) do
test_shell_script_job(
"Linux",
"ubuntu-latest",
shell,
"sudo apt-get update && sudo apt-get install -y #{shell}",
"sudo apt-get update && sudo apt-get install -y expect"
expect_install_command: "sudo apt-get update && sudo apt-get install -y expect",
os: "Linux",
runs_on: "ubuntu-latest",
shell: shell,
shell_install_command: "sudo apt-get update && sudo apt-get install -y #{shell}"
)
end

defp test_macos_script_job(shell) do
test_shell_script_job(
"macOS",
"macos-latest",
shell,
"brew install #{shell}",
"brew install expect"
expect_install_command: "brew install expect",
os: "macOS",
runs_on: "macos-latest",
shell: shell,
shell_install_command: "brew install #{shell}"
)
end

Expand Down
6 changes: 3 additions & 3 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: make -f test/scripts/Makefile serve
run: source ~/.bashrc && 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 @@ -67,7 +67,7 @@ jobs:
shell: /bin/fish -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: make -f test/scripts/Makefile serve
run: source ~/.config/fish/config.fish && make -f test/scripts/Makefile serve
shell: /bin/fish -l {0}
- name: Check HTTP status code
if: steps.result_cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
shell: /bin/zsh -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: 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
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
shell: /bin/bash -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: make -f test/scripts/Makefile serve
run: source ~/.bashrc && 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 @@ -71,7 +71,7 @@ jobs:
shell: /bin/fish -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: make -f test/scripts/Makefile serve
run: source ~/.config/fish/config.fish && make -f test/scripts/Makefile serve
shell: /bin/fish -l {0}
- name: Check HTTP status code
if: steps.result_cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
shell: /bin/zsh -l {0}
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: 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

0 comments on commit 6f4fe10

Please sign in to comment.