Skip to content

Commit 8555209

Browse files
authored
feat: update setup for 2025 (#31)
1 parent 2c492ce commit 8555209

File tree

4 files changed

+27
-31
lines changed

4 files changed

+27
-31
lines changed

.github/workflows/tests.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ on:
1010
workflow_dispatch:
1111
inputs:
1212
debug_enabled:
13-
description: 'Debug with tmate set "debug_enabled"'
13+
type: boolean
14+
description: Debug with tmate
1415
required: false
15-
default: "false"
16+
default: false
1617

17-
env:
18-
# Allow ddev get to use a github token to prevent rate limiting by tests
19-
DDEV_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
2021

21-
# Required permissions for keep-alive, used by ddev/github-action-add-on-test
22+
# This is required for "gautamkrishnar/keepalive-workflow", see "ddev/github-action-add-on-test"
2223
permissions:
2324
actions: write
2425

@@ -32,10 +33,10 @@ jobs:
3233
runs-on: ubuntu-latest
3334

3435
steps:
35-
- uses: ddev/github-action-add-on-test@v2
36-
with:
37-
ddev_version: ${{ matrix.ddev_version }}
38-
token: ${{ secrets.GITHUB_TOKEN }}
39-
debug_enabled: ${{ github.event.inputs.debug_enabled }}
40-
addon_repository: ${{ env.GITHUB_REPOSITORY }}
41-
addon_ref: ${{ env.GITHUB_REF }}
36+
- uses: ddev/github-action-add-on-test@v2
37+
with:
38+
ddev_version: ${{ matrix.ddev_version }}
39+
token: ${{ secrets.GITHUB_TOKEN }}
40+
debug_enabled: ${{ github.event.inputs.debug_enabled }}
41+
addon_repository: ${{ env.GITHUB_REPOSITORY }}
42+
addon_ref: ${{ env.GITHUB_REF }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![tests](https://github.com/ddev/ddev-varnish/actions/workflows/tests.yml/badge.svg)](https://github.com/ddev/ddev-varnish/actions/workflows/tests.yml) ![project is maintained](https://img.shields.io/maintenance/yes/2024.svg)
1+
[![tests](https://github.com/ddev/ddev-varnish/actions/workflows/tests.yml/badge.svg)](https://github.com/ddev/ddev-varnish/actions/workflows/tests.yml) ![project is maintained](https://img.shields.io/maintenance/yes/2025.svg)
22

33
# ddev-varnish
44

install.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,9 @@ project_files:
66
- varnish
77
- commands/varnish
88

9+
ddev_version_constraint: '>= v1.24.0'
10+
911
pre_install_actions:
10-
# Make sure we have a ddev version that can support what we do here
11-
- |
12-
#ddev-nodisplay
13-
#ddev-description:Checking DDEV version
14-
(ddev debug capabilities | grep ddev-get-yaml-interpolation >/dev/null) || (echo "Please upgrade DDEV to v1.21.4+ for appropriate capabilities" && false)
15-
# Make sure we have a ddev version that can support what we do here
1612
- |
1713
#ddev-nodisplay
1814
#ddev-description:Removing old docker-compose.varnish-extras.yaml

tests/test.bats

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,26 @@ setup() {
44
export TESTDIR=~/tmp/testvarnish
55
mkdir -p $TESTDIR
66
export PROJNAME=test-varnish
7-
export DDEV_NON_INTERACTIVE=true
7+
export DDEV_NONINTERACTIVE=true
88
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 || true
99
cd "${TESTDIR}"
1010
ddev config --project-name=${PROJNAME} --additional-hostnames=extrahostname --additional-fqdns=extrafqdn.ddev.site --omit-containers=db
11-
# dba is gone in v1.22.0, so try to do it but ignore results
12-
ddev config --omit-containers=dba,db >/dev/null 2>&1 || true
1311
printf "<?php\nphpinfo();\n" >index.php
14-
ddev start >/dev/null
12+
ddev start -y >/dev/null
1513
}
1614

1715
teardown() {
1816
set -eu -o pipefail
19-
cd ${TESTDIR} || (printf "unable to cd to ${TESTDIR}\n" && exit 1)
17+
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 )
2018
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1
2119
[ "${TESTDIR}" != "" ] && rm -rf ${TESTDIR}
2220
}
2321

2422
@test "install from directory" {
2523
set -eu -o pipefail
2624
cd ${TESTDIR}
27-
echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
28-
ddev get ${DIR} >/dev/null
25+
echo "# ddev add-on get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
26+
ddev add-on get ${DIR} >/dev/null
2927
ddev restart >/dev/null 2>&1
3028
for url in http://${PROJNAME}.ddev.site/ http://extrahostname.ddev.site/ http://extrafqdn.ddev.site/ https://${PROJNAME}.ddev.site/ https://extrahostname.ddev.site/ https://extrafqdn.ddev.site/ ; do
3129
# It's "Via:" with http and "via:" with https. Tell me why.
@@ -48,8 +46,8 @@ teardown() {
4846
set -eu -o pipefail
4947
cd ${TESTDIR}
5048
ddev config --router-http-port 8080 --router-https-port 8443 --mailpit-http-port 18025 --mailpit-https-port 18026
51-
echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
52-
ddev get ${DIR} >/dev/null
49+
echo "# ddev add-on get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
50+
ddev add-on get ${DIR} >/dev/null
5351
ddev restart >/dev/null 2>&1
5452
for url in http://${PROJNAME}.ddev.site:8080/ http://extrahostname.ddev.site:8080/ http://extrafqdn.ddev.site:8080/ https://${PROJNAME}.ddev.site:8443/ https://extrahostname.ddev.site:8443/ https://extrafqdn.ddev.site:8443/ ; do
5553
# It's "Via:" with http and "via:" with https. Tell me why.
@@ -68,11 +66,12 @@ teardown() {
6866
curl -sI "https://${PROJNAME}.ddev.site:18026" | grep -i "https://novarnish.${PROJNAME}.ddev.site:18026/" >/dev/null || (echo "# https://${PROJNAME}.ddev.site:18026 did not redirect" >&3 && exit 1);
6967
}
7068

69+
# bats test_tags=release
7170
@test "install from release" {
7271
set -eu -o pipefail
7372
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 )
74-
echo "# ddev get ddev/ddev-varnish with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
75-
ddev get ddev/ddev-varnish >/dev/null
73+
echo "# ddev add-on get ddev/ddev-varnish with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
74+
ddev add-on get ddev/ddev-varnish >/dev/null
7675
ddev restart >/dev/null 2>&1
7776
for url in http://${PROJNAME}.ddev.site/ http://extrahostname.ddev.site/ http://extrafqdn.ddev.site/ https://${PROJNAME}.ddev.site/ https://extrahostname.ddev.site/ https://extrafqdn.ddev.site/ ; do
7877
# It's "Via:" with http and "via:" with https. Tell me why.

0 commit comments

Comments
 (0)