From 174731f10c2056767a1853ddb186e642690dd598 Mon Sep 17 00:00:00 2001 From: Stanislav Zhuk Date: Thu, 10 Sep 2026 21:29:22 +0300 Subject: [PATCH 1/2] feat(download-ddev): add `tag:` and `pr:` values, stop compiling HEAD ## The Issue `ddev_version: HEAD` used `brew install --HEAD`, which compiled ddev from source on every run. Only `stable` and `HEAD` could be tested. ## How This PR Solves The Issue Homebrew always installs stable, then `ddev utility download-ddev` downloads the requested build into `$RUNNER_TEMP/ddev-bin` and prepends it to `PATH`. `ddev_version` also accepts `tag:` and `pr:` now. ## Manual Testing Instructions Run the add-ons test workflow with `ddev_version` set to `stable`, `HEAD`, `tag:v1.25.4` and `pr:`. The new `Show ddev version` step prints which build was used. ## Automated Testing Overview The matrix covers `stable` and `HEAD`, plus one job for `tag:v1.25.4`. It no longer runs every add-on, `ddev-add-on-monitoring` does that. ## Release/Deployment Notes `CHANGELOG.md` has a v2.6.0 entry, its PR links need the real number. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/add-ons-test.yml | 20 ++++-------- CHANGELOG.md | 16 ++++++++++ README.md | 13 ++++++-- action.yaml | 49 ++++++++++++++++++++++-------- 4 files changed, 70 insertions(+), 28 deletions(-) diff --git a/.github/workflows/add-ons-test.yml b/.github/workflows/add-ons-test.yml index 9607ad6..a68b709 100644 --- a/.github/workflows/add-ons-test.yml +++ b/.github/workflows/add-ons-test.yml @@ -41,22 +41,14 @@ jobs: add_on: - name: ddev/ddev-redis-insight test_command: "bats tests" - - name: ddev/ddev-mongo - test_command: "" - name: ddev/ddev-adminer test_command: "" - - name: ddev/ddev-redis - test_command: "" - - name: ddev/ddev-solr - test_command: "" - - name: ddev/ddev-nvm - test_command: "" - - name: ddev/ddev-memcached - test_command: "" - - name: ddev/ddev-cron - test_command: "" - - name: ddev/ddev-elasticsearch - test_command: "" + # One extra job to cover the `tag:` syntax, not one per add-on + include: + - ddev_version: "tag:v1.25.4" + add_on: + name: ddev/ddev-adminer + test_command: "" name: Add-on test runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index da860b4..97bb002 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,22 @@ The [public API](https://semver.org/spec/v2.0.0.html#spec-item-1) of this projec --- +## [v2.6.0](https://github.com/ddev/github-action-add-on-test/releases/tag/v2.6.0) - 2026-09-10 + +[_Compare with previous release_](https://github.com/ddev/github-action-add-on-test/compare/v2.5.0...v2.6.0) + +### Added + +- Accept `tag:` and `pr:` as `ddev_version` values, downloaded with `ddev utility download-ddev` ([PR #68](https://github.com/ddev/github-action-add-on-test/pull/68)) +- Print `ddev version` before the tests run ([PR #68](https://github.com/ddev/github-action-add-on-test/pull/68)) + +### Changed + +- Install `ddev_version: HEAD` by downloading the latest `main` build with `ddev utility download-ddev` instead of building it from source with `brew install --HEAD`, which is much faster ([PR #68](https://github.com/ddev/github-action-add-on-test/pull/68)) +- Download the Docker images with `ddev utility download-images`, falling back to `ddev debug download-images` for DDEV older than v1.24.9 ([PR #68](https://github.com/ddev/github-action-add-on-test/pull/68)) + +--- + ## [v2.5.0](https://github.com/ddev/github-action-add-on-test/releases/tag/v2.5.0) - 2026-09-01 [_Compare with previous release_](https://github.com/ddev/github-action-add-on-test/compare/v2.4.5...v2.5.0) diff --git a/README.md b/README.md index e966ff0..4311ced 100644 --- a/README.md +++ b/README.md @@ -61,13 +61,22 @@ Not required. Default: `stable`. -Allowed values are: `stable`, `HEAD`. +Allowed values: + +| Value | DDEV that will be used | +| --- | --- | +| `stable` | Latest stable release | +| `HEAD` | Latest `main` build | +| `tag:v1.25.3` | A specific released version | +| `pr:8611` | Build of `ddev/ddev` pull request 8611 | + +The stable release is always installed with Homebrew. For every other value, the requested build is then downloaded with [`ddev utility download-ddev`](https://docs.ddev.com/en/stable/users/usage/commands/#utility-download-ddev) and placed first in `PATH`, which takes seconds instead of compiling DDEV from source on every run. --- - `token` (_String_) -A GitHub Personal Access Token used by the `debug` and `run test` steps. +A GitHub Personal Access Token used by the DDEV download, `debug` and `run test` steps. Required. diff --git a/action.yaml b/action.yaml index 24d1f03..d881198 100644 --- a/action.yaml +++ b/action.yaml @@ -4,13 +4,9 @@ description: "A Github Action to run DDEV add-on tests" inputs: ddev_version: - type: choice required: false default: "stable" - description: "DDEV Version to use" - options: - - "stable" - - "HEAD" + description: "DDEV version to use: stable, HEAD, tag: or pr:" addon_repository: description: "Repository of the tested addon" @@ -67,23 +63,52 @@ runs: ref: ${{ inputs.addon_ref }} path: ${{ inputs.addon_path }} - - name: Use ddev stable + - name: Install ddev stable shell: bash - if: inputs.ddev_version == 'stable' run: | brew trust ddev/ddev brew install ddev/ddev/ddev >/dev/null - - name: Use ddev HEAD + - name: Use ddev ${{ inputs.ddev_version }} shell: bash - if: inputs.ddev_version == 'HEAD' + if: inputs.ddev_version != 'stable' && inputs.ddev_version != '' + env: + DDEV_VERSION: ${{ inputs.ddev_version }} + # Allow the download to use a GitHub token to prevent rate limiting + DDEV_GITHUB_TOKEN: ${{ inputs.token }} run: | - brew trust ddev/ddev - brew install --HEAD ddev/ddev/ddev >/dev/null + case "${DDEV_VERSION}" in + HEAD | head) + source_args=(--head) + ;; + tag:?*) + source_args=(--tag "${DDEV_VERSION#tag:}") + ;; + pr:?*) + source_args=(--pr "${DDEV_VERSION#pr:}") + ;; + *) + echo "::error::Unknown ddev_version '${DDEV_VERSION}', use stable, HEAD, tag: or pr:" + exit 1 + ;; + esac + ddev_bin_dir="${RUNNER_TEMP}/ddev-bin" + ddev utility download-ddev "${source_args[@]}" --output "${ddev_bin_dir}" + # Prepend to PATH, ddev finds ddev-hostname there too + echo "${ddev_bin_dir}" >> "${GITHUB_PATH}" + + - name: Show ddev version + shell: bash + run: ddev version - name: Download docker images shell: bash - run: ddev debug download-images >/dev/null + run: | + if ddev utility --help >/dev/null 2>&1; then + ddev utility download-images >/dev/null + else + ddev debug download-images >/dev/null + fi - name: Setup upterm session uses: owenthereal/action-upterm@47652056242288ccbebd30f836e9885d09a75365 # https://github.com/owenthereal/action-upterm/commits/v1.15.0/ From 350e0524391cb1429a60b2469dacdc1eb937d863 Mon Sep 17 00:00:00 2001 From: Stanislav Zhuk Date: Thu, 10 Sep 2026 21:49:03 +0300 Subject: [PATCH 2/2] use Homebrew source build as fallback --- CHANGELOG.md | 2 +- action.yaml | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97bb002..e460337 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ The [public API](https://semver.org/spec/v2.0.0.html#spec-item-1) of this projec ### Changed -- Install `ddev_version: HEAD` by downloading the latest `main` build with `ddev utility download-ddev` instead of building it from source with `brew install --HEAD`, which is much faster ([PR #68](https://github.com/ddev/github-action-add-on-test/pull/68)) +- Install `ddev_version: HEAD` by downloading the latest `main` build with `ddev utility download-ddev` instead of building it from source with `brew install --HEAD`, which is much faster. If the download fails, for example when nightly.link is down, the Homebrew source build is used as a fallback ([PR #68](https://github.com/ddev/github-action-add-on-test/pull/68)) - Download the Docker images with `ddev utility download-images`, falling back to `ddev debug download-images` for DDEV older than v1.24.9 ([PR #68](https://github.com/ddev/github-action-add-on-test/pull/68)) --- diff --git a/action.yaml b/action.yaml index d881198..99f5572 100644 --- a/action.yaml +++ b/action.yaml @@ -93,9 +93,16 @@ runs: ;; esac ddev_bin_dir="${RUNNER_TEMP}/ddev-bin" - ddev utility download-ddev "${source_args[@]}" --output "${ddev_bin_dir}" - # Prepend to PATH, ddev finds ddev-hostname there too - echo "${ddev_bin_dir}" >> "${GITHUB_PATH}" + if ddev utility download-ddev "${source_args[@]}" --output "${ddev_bin_dir}"; then + # Prepend to PATH, ddev finds ddev-hostname there too + echo "${ddev_bin_dir}" >> "${GITHUB_PATH}" + elif [ "${source_args[0]}" = "--head" ]; then + echo "::warning::Could not download the main build, building it with Homebrew instead" + brew unlink ddev >/dev/null + brew install --HEAD ddev/ddev/ddev >/dev/null + else + exit 1 + fi - name: Show ddev version shell: bash