Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Gitea Act Runner #101

Open
alex3305 opened this issue Aug 12, 2024 · 2 comments
Open

Compatibility with Gitea Act Runner #101

alex3305 opened this issue Aug 12, 2024 · 2 comments

Comments

@alex3305
Copy link

Hi Frenck 👋,

I've been trying to get this action working with Gitea Act Runner but it seems like something is off when running it on Act runner. I suspect it is the volume mount based on pwd here:

-v $(pwd):/github/workspace \

which seems to work on GitHub Actions, but not on Gitea. As I get the following error (snippet):

[...]
expression 'format('docker run --rm \\n  --entrypoint "" \\n  "ghcr.io/home-assistant/home-assistant:{0}" \\n    python -m homeassistant --version\nenv_file_arg=""\nif [[ -f "{1}" ]]; then\n  env_file_arg="--env-file {2}"\nfi\ndocker run --rm \\n  --entrypoint "" \\n  -v $(pwd):/github/workspace \\n  $env_file_arg \\n  --workdir /github/workspace \\n  "ghcr.io/home-assistant/home-assistant:{3}" \\n    python -m homeassistant \\n      --config "{4}" \\n      --script check_config\n', steps.version.outputs.version, inputs.env_file, inputs.env_file, steps.version.outputs.version, steps.check.outputs.path)' evaluated to '%!t(string=docker run --rm \\n  --entrypoint "" \\n  "ghcr.io/home-assistant/home-assistant:stable" \\n    python -m homeassistant --version\nenv_file_arg=""\nif [[ -f "" ]]; then\n  env_file_arg="--env-file "\nfi\ndocker run --rm \\n  --entrypoint "" \\n  -v $(pwd):/github/workspace \\n  $env_file_arg \\n  --workdir /github/workspace \\n  "ghcr.io/home-assistant/home-assistant:stable" \\n    python -m homeassistant \\n      --config "/workspace/homeassistant/config" \\n      --script check_config\n)'
Wrote command \n\ndocker run --rm \\n  --entrypoint "" \\n  "ghcr.io/home-assistant/home-assistant:stable" \\n    python -m homeassistant --version\nenv_file_arg=""\nif [[ -f "" ]]; then\n  env_file_arg="--env-file "\nfi\ndocker run --rm \\n  --entrypoint "" \\n  -v $(pwd):/github/workspace \\n  $env_file_arg \\n  --workdir /github/workspace \\n  "ghcr.io/home-assistant/home-assistant:stable" \\n    python -m homeassistant \\n      --config "/workspace/homeassistant/config" \\n      --script check_config\n\n\n to 'workflow/5-composite-4.sh'
Writing entry to tarball workflow/5-composite-4.sh len:478
Extracting content to '/var/run/act'
  🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/5-composite-4.sh] user= workdir=
Exec command '[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/5-composite-4.sh]'
Working directory '/workspace/homeassistant/config'
2024.8.1
Testing configuration at /workspace/homeassistant/config
Failed config
  General Errors: 
    - File configuration.yaml not found.
Successful config (partial)
  ❌  Failure - Main 🚀 Run Home Assistant Configuration Check
exitcode '1': failure
  ❌  Failure - Main Run Home Assistant Configuration Check
exitcode '1': failure
evaluating expression 'always()'
expression 'always()' evaluated to 'true'
[...]

However as you can see, Act Runner checks out in /workspace/homeassistant/config which is the same as $GITHUB_WORKSPACE. However on GitHub Actions this just works™ 🤷 . I've looked into setting the path on the Action itself, but that's only a relative path to $GITHUB_WORKSPACE. So I guess this is useless.

So in general I was wondering what your stance is on compatibility with Gitea runner? I assume that it isn't a part of your stack and you don't want to invest any time in it. But would you be open for PR's regarding this?

Thanks ❤️

@liquidthex
Copy link

I am also experiencing this issue. I was going crazy until I found your issue, so thank you for that.

Have you had any luck with a workaround?

@alex3305
Copy link
Author

alex3305 commented Feb 5, 2025

@liquidthex I had the same thing until I opened this issue 😜. I've created my personal, private fork on my Gitea Forgejo instance which has been chugging away for about half a year now 🙂. The main issue is that volume mounting doesn't work as expected in act compatible runners. This is outlined in gitea/act_runner#189 and can easily be fixed with:

diff --git a/action.yaml b/action.yaml
--- a/action.yaml
+++ b/action.yaml
@@ -103,7 +103,7 @@ runs:
           env_file_arg="--env-file ${{ inputs.env_file }}"
         fi
         docker run --rm --entrypoint "" \
-          -v $(pwd):/github/workspace \
+          --volumes-from ${{ env.JOB_CONTAINER_NAME }} \
           $env_file_arg \
           --workdir /github/workspace \
           "ghcr.io/home-assistant/home-assistant:${{ steps.version.outputs.version }}" \
```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants