|
5 | 5 | * [What is ddev-addon-template?](#what-is-ddev-addon-template) |
6 | 6 | * [Components of the repository](#components-of-the-repository) |
7 | 7 | * [Getting started](#getting-started) |
| 8 | +* [How to debug in Github Actions](#how-to-debug-in-github-actions) |
8 | 9 |
|
9 | 10 | ## What is ddev-addon-template? |
10 | 11 |
|
@@ -46,6 +47,45 @@ A repository like this one is the way to get started. You can create a new repo |
46 | 47 |
|
47 | 48 | Note that more advanced techniques are discussed in [DDEV docs](https://ddev.readthedocs.io/en/latest/users/extend/additional-services/#additional-service-configurations-and-add-ons-for-ddev). |
48 | 49 |
|
| 50 | +## How to debug in Github Actions |
| 51 | +1. You need a SSH-key registered with Github. You either pick the key you already authenticate with `github.com` or you create a dedicated new one with `ssh-keygen -t ed25519 -a 64 -f tmate_ed25519 -C "$(date +'%d-%m-%Y')"` and add it at `https://github.com/settings/keys`. |
| 52 | + |
| 53 | +2. Add the following snippet to `~/.ssh/config` |
| 54 | + |
| 55 | +``` |
| 56 | +Host *.tmate.io |
| 57 | + User git |
| 58 | + AddKeysToAgent yes |
| 59 | + UseKeychain yes |
| 60 | + PreferredAuthentications publickey |
| 61 | + IdentitiesOnly yes |
| 62 | + IdentityFile ~/.ssh/tmate_ed25519 |
| 63 | +``` |
| 64 | +3. Go to `https://github.com/<user>/<repo>/actions/workflows/tests.yml`. |
| 65 | + |
| 66 | +4. Click the `Run workflow`- button and you will have the option to the select the branch to run the workflow from and activate `tmate` by checking the `Debug with tmate` checkbox for this run. |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | +5. After the `workflow_dispatch`-event was triggered click the `All workflows`-link in the sidebar and then click the in progress workflow `tests`. |
| 71 | + |
| 72 | +7. Pick one of the jobs in progress in the sidebar. |
| 73 | + |
| 74 | +8. Wait until the current task list reaches the `tmate debugging session` section and the output shows something like: |
| 75 | + |
| 76 | +``` |
| 77 | + |
| 78 | +107 or: ssh -i <path-to-private-SSH-key> [email protected] |
| 79 | + |
| 80 | +109 or: ssh -i <path-to-private-SSH-key> [email protected] |
| 81 | +``` |
| 82 | + |
| 83 | +9. Copy and execute the first option `ssh [email protected]` in the terminal and continue by pressing either `q` or `ctrl-c`. |
| 84 | + |
| 85 | +10. Start the bats test with `bats tests/test.bats`. |
| 86 | + |
| 87 | +For a more detailed documentation about `tmate` see [Debug your GitHubActions by using tmate](https://mxschmitt.github.io/action-tmate/) |
| 88 | + |
49 | 89 | **Contributed and maintained by [@CONTRIBUTOR](https://github.com/CONTRIBUTOR) based on the original [ddev-contrib recipe](https://github.com/ddev/ddev-contrib/tree/master/docker-compose-services/RECIPE) by [@CONTRIBUTOR](https://github.com/CONTRIBUTOR)** |
50 | 90 |
|
51 | 91 | **Originally Contributed by [somebody](https://github.com/somebody) in <https://github.com/ddev/ddev-contrib/> |
0 commit comments