File tree Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 8
8
fail-fast : false
9
9
matrix :
10
10
os : [ubuntu-20.04, ubuntu-22.04]
11
+ version : ['latest', '1.22.3']
11
12
steps :
12
13
- uses : actions/checkout@v4
13
14
- uses : ./
14
15
with :
15
16
ddevDir : tests/fixtures/ddevProj1
16
17
autostart : false
18
+ version : ${{ matrix.version }}
19
+ - name : ddev version
20
+ run : |
21
+ if [[ ${{ matrix.version }} == '1.22.3' ]]; then
22
+ test "$(ddev --version)" == 'ddev version v1.22.3'
23
+ else
24
+ test "$(ddev --version)" != 'ddev version v1.22.3'
25
+ fi
17
26
- name : ddev stopped
18
27
run : |
19
28
cd tests/fixtures/ddevProj1
Original file line number Diff line number Diff line change @@ -55,6 +55,18 @@ default: `true`
55
55
autostart: false
56
56
` ` `
57
57
58
+ # ### version
59
+
60
+ Install a specific ddev version. The version must be available in ddev's apt repository.
61
+
62
+ default : ` latest`
63
+
64
+ ` ` ` yaml
65
+ - uses: ddev/github-action-setup-ddev@v1
66
+ with:
67
+ version: 1.22.4
68
+ ` ` `
69
+
58
70
# # Common recipes
59
71
60
72
# ## SSH keys
Original file line number Diff line number Diff line change @@ -17,3 +17,7 @@ inputs:
17
17
description : ' Start ddev automatically'
18
18
required : false
19
19
default : true
20
+ version :
21
+ description : ' Install a specific ddev version, such as 1.22.4'
22
+ required : false
23
+ default : ' latest'
Original file line number Diff line number Diff line change @@ -65,9 +65,23 @@ function run() {
65
65
cmd = 'echo "deb https://apt.fury.io/drud/ * *" | sudo tee -a /etc/apt/sources.list.d/ddev.list' ;
66
66
console . log ( cmd ) ;
67
67
yield execShellCommand ( cmd ) ;
68
- cmd = 'sudo apt-get update && sudo apt-get install -y ddev && mkcert -install' ;
68
+
69
+ const version = core . getInput ( 'version' ) || 'latest' ;
70
+ let ddevPackage = 'ddev' ;
71
+ if ( version !== 'latest' ) {
72
+ ddevPackage += `=${ version } ` ;
73
+ }
74
+
75
+ cmd = `sudo apt-get update && sudo apt-get install -y ${ ddevPackage } && mkcert -install` ;
69
76
console . log ( cmd ) ;
70
77
yield execShellCommand ( cmd ) ;
78
+
79
+ if ( version !== 'latest' ) {
80
+ cmd = 'sudo apt-mark hold ddev' ;
81
+ console . log ( cmd ) ;
82
+ yield execShellCommand ( cmd ) ;
83
+ }
84
+
71
85
cmd = 'ddev --version' ;
72
86
console . log ( cmd ) ;
73
87
yield execShellCommand ( cmd ) ;
You can’t perform that action at this time.
0 commit comments