Skip to content

Commit

Permalink
Add some selfupdate integration tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stronk7 committed Jan 11, 2024
1 parent 5ad82b0 commit a5fe2b4
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,45 @@ jobs:
php build/moodle-plugin-ci.phar phpunit --verbose --coverage-text --fail-on-warning
php build/moodle-plugin-ci.phar behat --profile default
php build/moodle-plugin-ci.phar behat --profile chrome
selfupdatetest:
name: SelfUpdate tests (PHAR)
runs-on: ubuntu-22.04
env:
lowest_release: '4.1.8'

strategy:
fail-fast: false
matrix:
include:
# Each supported PHP version once. That's enough.
- php: '8.2'
- php: '8.1'
- php: '8.0'
- php: '7.4'

steps:
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: pgsql, zip, gd, xmlrpc, soap
ini-values: max_input_vars=5000
coverage: none

- name: Download base ${{ env.lowest_release }} PHAR artifact
uses: robinraju/[email protected]
with:
repository: moodlehq/moodle-plugin-ci
tag: ${{ env.lowest_release }}
fileName: moodle-plugin-ci.phar

- name: Self update PHAR to actual
run: |
php moodle-plugin-ci.phar selfupdate
php moodle-plugin-ci.phar --version | grep -qv "${{ env.lowest_release }}"
- name: Self update rollback PHAR to base ${{ env.lowest_release }}
run: |
php moodle-plugin-ci.phar selfupdate --rollback
php moodle-plugin-ci.phar --version | grep -q "${{ env.lowest_release }}"

0 comments on commit a5fe2b4

Please sign in to comment.