Skip to content

Commit a59d6eb

Browse files
authored
feat: add testing for DDEV HEAD (#57)
1 parent 657b133 commit a59d6eb

File tree

3 files changed

+50
-13
lines changed

3 files changed

+50
-13
lines changed

.github/workflows/main.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ on:
99
paths-ignore:
1010
- "**.md"
1111
workflow_dispatch:
12+
inputs:
13+
debug_enabled:
14+
description: 'Run the build with tmate set "debug_enabled"'
15+
type: boolean
16+
required: false
17+
default: false
1218
schedule:
1319
- cron: 0 0 * * *
1420

@@ -19,30 +25,54 @@ jobs:
1925
fail-fast: false
2026
matrix:
2127
os: [ubuntu-24.04, ubuntu-24.04-arm]
22-
version: ['latest', '1.24.7']
28+
version: ['latest', 'head', '1.24.8']
2329
steps:
2430
- uses: actions/checkout@v5
2531
- uses: ./
2632
with:
2733
ddevDir: tests/fixtures/ddevProj1
2834
autostart: false
2935
version: ${{ matrix.version }}
36+
37+
- name: Setup tmate session
38+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
39+
uses: mxschmitt/action-tmate@v3
40+
with:
41+
limit-access-to-actor: true
42+
3043
- name: ddev version
3144
run: |
32-
if [[ ${{ matrix.version }} == '1.24.7' ]]; then
33-
test "$(ddev --version)" == 'ddev version v1.24.7'
45+
ddev --version
46+
if [[ ${{ matrix.version }} == '1.24.8' ]]; then
47+
test "$(ddev --version)" == 'ddev version v1.24.8'
3448
else
35-
test "$(ddev --version)" != 'ddev version v1.24.7'
49+
test "$(ddev --version)" != 'ddev version v1.24.8'
3650
fi
51+
3752
- name: ddev stopped
3853
run: |
3954
cd tests/fixtures/ddevProj1
4055
test '"stopped"' = "$(ddev describe --json-output | jq '.raw.status')"
56+
4157
- name: start ddev
4258
run: |
4359
cd tests/fixtures/ddevProj1
4460
ddev start --json-output --skip-confirmation
61+
4562
- name: Mailpit reachable
4663
run: curl --silent --dump-header - --output /dev/null https://setup-ddev-proj1.ddev.site:8026
64+
4765
- name: "index.html: expected output"
4866
run: test 'index.html test output' = "$(curl --silent https://setup-ddev-proj1.ddev.site)"
67+
68+
- name: restart ddev with project_tld=test
69+
run: |
70+
cd tests/fixtures/ddevProj1
71+
ddev config --project-tld=test
72+
ddev restart --json-output --skip-confirmation
73+
74+
- name: Mailpit reachable
75+
run: curl --silent --dump-header - --output /dev/null https://setup-ddev-proj1.test:8026
76+
77+
- name: "index.html: expected output"
78+
run: test 'index.html test output' = "$(curl --silent https://setup-ddev-proj1.test)"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ default: `latest`
8484
```yaml
8585
- uses: ddev/github-action-setup-ddev@v1
8686
with:
87-
version: 1.24.7
87+
version: 1.24.8
8888
```
8989

9090
### installScriptUrl
@@ -112,7 +112,7 @@ Example with custom script source:
112112
uses: ddev/github-action-setup-ddev@v1
113113
with:
114114
installScriptUrl: "https://my-company.com/scripts/custom_ddev_install.sh"
115-
version: "v1.24.7"
115+
version: "v1.24.8"
116116
```
117117

118118
## Common recipes

action.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,26 @@ runs:
2929
- name: Download DDEV install script
3030
shell: bash
3131
run: |
32-
curl -fsSL --retry 3 --retry-max-time 60 --retry-connrefused \
33-
-o /tmp/install_ddev.sh \
34-
"${{ inputs.installScriptUrl }}"
32+
if [[ '${{ inputs.version }}' == 'head' && '${{ inputs.installScriptUrl }}' == 'https://ddev.com/install.sh' ]]; then
33+
SCRIPT_URL="https://raw.githubusercontent.com/ddev/ddev/main/scripts/install_ddev_head.sh"
34+
echo "Using head version install script: ${SCRIPT_URL}"
35+
else
36+
SCRIPT_URL="${{ inputs.installScriptUrl }}"
37+
fi
38+
curl -fsSL --retry 3 --retry-max-time 60 --retry-connrefused -o /tmp/install_ddev.sh "${SCRIPT_URL}"
3539
3640
- name: Install DDEV
3741
shell: bash
3842
run: |
39-
if [[ '${{ inputs.version }}' != 'latest' ]]; then
43+
if [[ '${{ inputs.version }}' == 'latest' ]]; then
44+
VERSION_ARG=""
45+
echo "Installing latest stable DDEV version"
46+
elif [[ '${{ inputs.version }}' == 'head' ]]; then
47+
VERSION_ARG=""
48+
echo "Installing DDEV HEAD version"
49+
else
4050
VERSION_ARG="v${{ inputs.version }}"
4151
echo "Installing DDEV version: ${VERSION_ARG}"
42-
else
43-
VERSION_ARG=""
44-
echo "Installing latest DDEV version"
4552
fi
4653
4754
# Make installation script executable

0 commit comments

Comments
 (0)