Skip to content

Commit a79ed0a

Browse files
committed
Add some selfupdate integration tests
We just start with the 4.1.8 release that was the first supporting the selfupdate command. Then we upgrade to actual and then rollback to confirm that we are back to the original one. That should be enough to have it continuously covered.
1 parent 9fad129 commit a79ed0a

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,3 +261,45 @@ jobs:
261261
php build/moodle-plugin-ci.phar behat --profile default
262262
php build/moodle-plugin-ci.phar behat --profile chrome
263263
php build/moodle-plugin-ci.phar behat --profile firefox --tags="@local_ci&&~@app"
264+
265+
selfupdatetest:
266+
name: SelfUpdate tests (PHAR)
267+
runs-on: ubuntu-22.04
268+
env:
269+
lowest_release: '4.1.8'
270+
271+
strategy:
272+
fail-fast: false
273+
matrix:
274+
include:
275+
# Each supported PHP version once. That's enough.
276+
- php: '8.2'
277+
- php: '8.1'
278+
- php: '8.0'
279+
- php: '7.4'
280+
281+
steps:
282+
- name: Setup PHP ${{ matrix.php }}
283+
uses: shivammathur/setup-php@v2
284+
with:
285+
php-version: ${{ matrix.php }}
286+
extensions: pgsql, zip, gd, xmlrpc, soap
287+
ini-values: max_input_vars=5000
288+
coverage: none
289+
290+
- name: Download base ${{ env.lowest_release }} PHAR artifact
291+
uses: robinraju/[email protected]
292+
with:
293+
repository: moodlehq/moodle-plugin-ci
294+
tag: ${{ env.lowest_release }}
295+
fileName: moodle-plugin-ci.phar
296+
297+
- name: Self update PHAR to actual
298+
run: |
299+
php moodle-plugin-ci.phar selfupdate
300+
php moodle-plugin-ci.phar --version | grep -qv "${{ env.lowest_release }}"
301+
302+
- name: Self update rollback PHAR to base ${{ env.lowest_release }}
303+
run: |
304+
php moodle-plugin-ci.phar selfupdate --rollback
305+
php moodle-plugin-ci.phar --version | grep -q "${{ env.lowest_release }}"

0 commit comments

Comments
 (0)