Skip to content

Commit 8c39807

Browse files
authored
ci: use github action for bulk of github test (#31)
1 parent 23447ca commit 8c39807

File tree

2 files changed

+14
-67
lines changed

2 files changed

+14
-67
lines changed

.github/workflows/tests.yml

Lines changed: 8 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -19,73 +19,20 @@ on:
1919
permissions:
2020
contents: write
2121

22-
defaults:
23-
run:
24-
shell: bash
25-
26-
env:
27-
# NIGHTLY_DDEV_PR_URL: "https://nightly.link/ddev/ddev/actions/runs/1720215802/ddev-linux-amd64.zip"
28-
# Allow ddev get to use a github token to prevent rate limiting by tests
29-
DDEV_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
# Allow `--HEAD` flag when running tests against HEAD
31-
3222
jobs:
3323
tests:
34-
defaults:
35-
run:
36-
shell: bash
37-
3824
strategy:
3925
matrix:
4026
ddev_version: [stable, HEAD]
41-
# ddev_version: [stable, edge, HEAD, PR]
4227
fail-fast: false
4328

44-
runs-on: ubuntu-20.04
29+
runs-on: ubuntu-latest
4530

4631
steps:
47-
- uses: actions/checkout@v3
48-
- name: Set up Homebrew
49-
id: set-up-homebrew
50-
uses: Homebrew/actions/setup-homebrew@master
51-
- name: Environment setup
52-
run: |
53-
brew install bats-core mkcert
54-
mkcert -install
55-
56-
- name: Use ddev stable
57-
if: matrix.ddev_version == 'stable'
58-
run: brew install ddev/ddev/ddev
59-
60-
- name: Use ddev edge
61-
if: matrix.ddev_version == 'edge'
62-
run: brew install ddev/ddev-edge/ddev
63-
64-
- name: Use ddev HEAD
65-
if: matrix.ddev_version == 'HEAD'
66-
run: brew install --HEAD ddev/ddev/ddev
67-
68-
- name: Use ddev PR
69-
if: matrix.ddev_version == 'PR'
70-
run: |
71-
curl -sSL -o ddev_linux.zip ${NIGHTLY_DDEV_PR_URL}
72-
unzip ddev_linux.zip
73-
mv ddev /usr/local/bin/ddev && chmod +x /usr/local/bin/ddev
74-
75-
- name: Download docker images
76-
run: mkdir junk && pushd junk && ddev config --auto && ddev debug download-images >/dev/null
77-
78-
- name: tmate debugging session
79-
uses: mxschmitt/action-tmate@v3
80-
with:
81-
limit-access-to-actor: true
82-
github-token: ${{ secrets.GITHUB_TOKEN }}
83-
if: github.event.inputs.debug_enabled == 'true'
84-
85-
- name: tests
86-
run: bats tests
87-
88-
# keepalive-workflow adds a dummy commit if there's no other action here, keeps
89-
# GitHub from turning off tests after 60 days
90-
- uses: gautamkrishnar/keepalive-workflow@v1
91-
if: matrix.ddev_version == 'stable'
32+
- uses: ddev/github-action-add-on-test@v1
33+
with:
34+
ddev_version: ${{ matrix.ddev_version }}
35+
token: ${{ secrets.GITHUB_TOKEN }}
36+
debug_enabled: ${{ github.event.inputs.debug_enabled }}
37+
addon_repository: ${{ env.GITHUB_REPOSITORY }}
38+
addon_ref: ${{ env.GITHUB_REF }}

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
This repository is a template for providing [DDEV](https://ddev.readthedocs.io) add-ons and services.
1313

14-
In DDEV addons can be installed from the command line using the `ddev get` command, for example, `ddev get ddev/ddev-addon-template` or `ddev get ddev/ddev-drupal9-solr`.
14+
In DDEV addons can be installed from the command line using the `ddev get` command, for example, `ddev get ddev/ddev-redis` or `ddev get ddev/ddev-solr`.
1515

16-
A repository like this one is the way to get started. You can create a new repo from this one by clicking the template button in the top right corner of the page.
16+
This repository is a quick way to get started. You can create a new repo from this one by clicking the template button in the top right corner of the page.
1717

1818
![template button](images/template-button.png)
1919

@@ -41,13 +41,14 @@ A repository like this one is the way to get started. You can create a new repo
4141
8. Create a release on GitHub.
4242
9. Test manually with `ddev get <owner/repo>`.
4343
10. You can test PRs with `ddev get https://github.com/<user>/<repo>/tarball/<branch>`
44-
11. Update the README.md to describe the add-on, how to use it, and how to contribute. If there are any manual actions that have to be taken, please explain them. If it requires special configuration of the using project, please explain how to do those. Examples in [ddev/ddev-drupal9-solr](https://github.com/ddev/ddev-drupal9-solr), [ddev/ddev-memcached](github.com/ddev/ddev-memcached), and [ddev/ddev-beanstalkd](https://github.com/ddev/ddev-beanstalkd).
44+
11. Update the README.md to describe the add-on, how to use it, and how to contribute. If there are any manual actions that have to be taken, please explain them. If it requires special configuration of the using project, please explain how to do those. Examples in [ddev/ddev-solr](https://github.com/ddev/ddev-solr), [ddev/ddev-memcached](github.com/ddev/ddev-memcached), and (advanced) [ddev-platformsh](https://github.com/ddev/ddev-platformsh).
4545
12. Add a good short description to your repo, and add the label "ddev-get". It will immediately be added to the list provided by `ddev get --list --all`.
4646
13. When it has matured you will hopefully want to have it become an "official" maintained add-on. Open an issue in the [ddev queue](https://github.com/ddev/ddev/issues) for that.
4747

4848
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).
4949

50-
## How to debug in Github Actions
50+
## How to debug tests (Github Actions)
51+
5152
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`.
5253

5354
2. Add the following snippet to `~/.ssh/config`
@@ -86,6 +87,5 @@ Host *.tmate.io
8687

8788
For a more detailed documentation about `tmate` see [Debug your GitHubActions by using tmate](https://mxschmitt.github.io/action-tmate/)
8889

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)**
9090

91-
**Originally Contributed by [somebody](https://github.com/somebody) in <https://github.com/ddev/ddev-contrib/>
91+
**Contributed and maintained by [@CONTRIBUTOR](https://github.com/CONTRIBUTOR)**

0 commit comments

Comments
 (0)