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 88 fail-fast : false
99 matrix :
1010 os : [ubuntu-20.04, ubuntu-22.04]
11+ version : ['latest', '1.22.3']
1112 steps :
1213 - uses : actions/checkout@v4
1314 - uses : ./
1415 with :
1516 ddevDir : tests/fixtures/ddevProj1
1617 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
1726 - name : ddev stopped
1827 run : |
1928 cd tests/fixtures/ddevProj1
Original file line number Diff line number Diff line change @@ -55,6 +55,18 @@ default: `true`
5555 autostart: false
5656` ` `
5757
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+
5870# # Common recipes
5971
6072# ## SSH keys
Original file line number Diff line number Diff line change @@ -17,3 +17,7 @@ inputs:
1717 description : ' Start ddev automatically'
1818 required : false
1919 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() {
6565 cmd = 'echo "deb https://apt.fury.io/drud/ * *" | sudo tee -a /etc/apt/sources.list.d/ddev.list' ;
6666 console . log ( cmd ) ;
6767 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` ;
6976 console . log ( cmd ) ;
7077 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+
7185 cmd = 'ddev --version' ;
7286 console . log ( cmd ) ;
7387 yield execShellCommand ( cmd ) ;
You can’t perform that action at this time.
0 commit comments