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

Poor Github Actions support #62

Open
guijan opened this issue Jan 31, 2024 · 1 comment
Open

Poor Github Actions support #62

guijan opened this issue Jan 31, 2024 · 1 comment

Comments

@guijan
Copy link

guijan commented Jan 31, 2024

It would be nice if termux-docker supported Github Actions better. Hopefully, people will add Termux to their CI.

I made a test repository to showcase it: guijan/termux-on-gha

The issue is that right now there's no documentation on how to get it working, and the straightforward way is broken. Here's the current state of things:
https://github.com/guijan/termux-on-gha/blob/a9a2cf26be0299c1643be12acfa301b0465ad2c1/.github/workflows/build-and-test.yml
The file is short and commented, hopefully it's easy to follow.

Users need to prefix pkg and pip with the /entrypoint.sh script because otherwise they run as the root user and error. This happens because github overrides the entrypoint, as can be seen here: https://github.com/orgs/community/discussions/26465

If you fix the issue above, you will run into further breakage. The widely used checkout and upload-artifact actions don't currently work with Termux. The checkout action errors because of the same problem as this issue I found out there (no /etc/os-release file, and possibly more): prometheus/prometheus#12656
Someone has suggested adding an /etc/os-release to Termux before: termux/termux-app#2620

I haven't investigated why the upload-artifact action fails.

@robertkirkman
Copy link

robertkirkman commented Jan 22, 2025

Hello,

This problem is tracked upstream in actions/upload-artifact in the context of old-glibc GNU/Linux, 32-bit GNU/Linux, and Alpine Linux.

The same concept naturally extends to termux-docker. Since Termux is an Android-based distro, it uses a node binary that has been compiled against bionic-libc and packaged for distribution in Termux. Therefore, it is possible to adapt the workaround given in the upstream issue to termux-docker, and use it to successfully extend your example to include a functioning upload-artifact action step.

I have forked your repository and added a commit in which I implemented an example of successfully using actions/upload-artifact within a container: termux/termux-docker GitHub Actions workflow job. You and others can see this to help you understand at least one feasible workaround for how to use termux-docker for your desired use-case.

Also, it might be helpful to mention that TUR utilizes termux-docker within GitHub Actions via a large workflow involving self-hosted runners and manually-invoked Docker sessions, and a script build-termux-docker.sh that micromanages the container; however, that approach is a bit overengineered for the needs of average users and requires a much larger amount of boilerplate, it just might serve as a good example to understand one large repository in which termux-docker is currently used in production.

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