From 6f4fe105ca8dc2758d072d35628e784202c08e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Almir=20Saraj=C4=8Di=C4=87?= Date: Tue, 17 Sep 2024 19:32:23 +0200 Subject: [PATCH] Debug --- .github/github_workflows.ex | 42 ++++++++++++++++++++++++------------- .github/workflows/main.yml | 6 +++--- .github/workflows/pr.yml | 6 +++--- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/.github/github_workflows.ex b/.github/github_workflows.ex index c17ee54ce..f4351cfb2 100644 --- a/.github/github_workflows.ex +++ b/.github/github_workflows.ex @@ -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, @@ -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}" ], [ @@ -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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2b30e4c75..417b99920 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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' @@ -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' @@ -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' diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2e45351ab..9693fd8b4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -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' @@ -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' @@ -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'