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 Feb 5, 2024
1 parent 9fad129 commit a79ed0a
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 @@ -261,3 +261,45 @@ jobs:
php build/moodle-plugin-ci.phar behat --profile default
php build/moodle-plugin-ci.phar behat --profile chrome
php build/moodle-plugin-ci.phar behat --profile firefox --tags="@local_ci&&~@app"
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/release-downloader@v1.8
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 a79ed0a

Please sign in to comment.