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..e460337 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. 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)) + +--- + ## [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..99f5572 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,59 @@ 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" + 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 + 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/