-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Support nektos/act for local GitHub actions testing #22
base: main
Are you sure you want to change the base?
Conversation
I have never gotten act to work for anything! Glad this can make it work here. |
Is there a way I can test this? |
I think you should be able to do it by installing and using https://github.com/nektos/act |
Any progress here? |
Why has this PR not yet found its way into the main branch? Is there anything against it? If not, please merge. |
2d641e1
to
2db43a8
Compare
It hasn't gotten a review from anybody. Nobody has reported manually testing it with success. I rebased it. Please experiment with it and review it. It can be found at https://github.com/justafish/github-action-setup-ddev/tree/justafish/support-nektos-act |
@rfay But unfortunately this does not work in my environment with Win11/WSL2 (Docker is installed inside WSL). When the command |
@freshworkx If I understand what you're saying you tested this PR and couldn't get it to work. My own experience is that I've never gotten nektos/act to work for anything I've wanted it to work for, but @justafish must be succeeding... |
@rfay |
she has tested it on Linux and Mac M1 |
cmd = `sudo chown runner:docker /var/run/docker.sock`; | ||
console.log(cmd); | ||
yield execShellCommand(cmd); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIR this will change it on the host too, which can have side effects.
Maybe this is a better solution?
nektos/act#1798 (comment)
I did a little testing over the weekend. The solution from @penyaskito nektos/act#1798 (comment) seems to work without modifying the |
Sorry I haven't noticed this PR. But if I understand that correctly, we do not need this PR anymore and the solution for docker-in-docker is instead a different Although I have worked a lot with Github actions I have not used |
Tried a quick play around but without luck. This PR changed cause permission issues with Docker; which required a WSL restart to fix. The closest I could get was using
$ act --container-options "--group-add $(stat -c %g /var/run/docker.sock)" -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:runner-latest
...
| Container ddev-router Running
|
| Waiting 120s for additional project containers [ddev-cypress-ddev-l11-cypress] to become ready...
|
| Successfully started cypress-ddev-l11
|
| Your project can be reached at https://cypress-ddev-l11.ddev.site
| See 'ddev describe' for alternate URLs.
|
[tests/✅ Cypress ] ✅ Success - Main ⚙️ DDEV This appeared to work , as seen above with DDEV reporting the containers successfully started. [tests/✅ Cypress ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/2] user= workdir=
| The repository at "/var/www/html" does not have the correct ownership and git refuses to use it:
|
| fatal: detected dubious ownership in repository at '/var/www/html'
| To add an exception for this directory, call:
|
| git config --global --add safe.directory /var/www/html
|
| Installing dependencies from lock file (including require-dev)
| Verifying lock file contents can be installed on current platform.
| Package operations: 113 installs, 0 updates, 0 removals
|
| In Filesystem.php line 261:
|
| /var/www/html/vendor does not exist and could not be created: Sample workflow: e2e:
name: '✅ Cypress'
runs-on: ubuntu-latest
steps:
- name: '☁️ Checkout repository'
uses: actions/checkout@v4
- name: '⚙️ DDEV'
uses: ddev/github-action-setup-ddev@v1
- name: '⚙️ Project'
run: |
ddev composer install |
Thanks Tyler! |
The Issue
Running DDEV with act is not currently possible
How This PR Solves The Issue
See nektos/act#724
Manual Testing Instructions
Create a new workflow with this action:
Run act:
Automated Testing Overview
Modification for locals
Related Issue Link(s)
Release/Deployment Notes