Skip to content

Commit 7910969

Browse files
Merge pull request #25 from geoffreyvanwyk/support/test-each-moodle-version
chore(ci): Test each supported Moodle version
2 parents 6ebddc4 + 537198d commit 7910969

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,18 @@ jobs:
5959
name: Molecule
6060
runs-on: ubuntu-22.04
6161
strategy:
62-
max-parallel: 4
6362
matrix:
6463
molecule-scenario:
6564
- default
6665
- mariadb
6766
ubuntu-version:
6867
- ubuntu2004
6968
- ubuntu2204
69+
moodle-version:
70+
- MOODLE_39_STABLE
71+
- MOODLE_400_STABLE
72+
- MOODLE_401_STABLE
73+
- MOODLE_402_STABLE
7074

7175
steps:
7276
- name: Check out the codebase.
@@ -88,3 +92,4 @@ jobs:
8892
PY_COLORS: "1"
8993
ANSIBLE_FORCE_COLOR: "1"
9094
MOLECULE_DISTRO: ${{ matrix.ubuntu-version }}
95+
MOLECULE_MOODLE_VERSION: ${{ matrix.moodle-version }}

molecule/default/molecule.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ provisioner:
3737
host_vars:
3838
ansible_role_moodle_molecule_${MOLECULE_DISTRO:-ubuntu2204}:
3939
ansible_user: ubuntu
40+
moodle_deploy_version: ${MOLECULE_MOODLE_VERSION:-MOODLE_402_STABLE}
4041
verifier:
4142
name: ansible

molecule/mariadb/molecule.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ provisioner:
3535
host_vars:
3636
ansible_role_moodle_molecule_${MOLECULE_DISTRO:-ubuntu2204}:
3737
ansible_user: ubuntu
38+
moodle_deploy_version: ${MOLECULE_MOODLE_VERSION:-MOODLE_402_STABLE}
3839
verifier:
3940
name: ansible

tasks/install_moodle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
- --adminuser={{ moodle_admin_username }}
6666
- --adminpass={{ moodle_admin_password }}
6767
- --adminemail={{ moodle_admin_email }}
68-
- --supportemail={{ moodle_support_email }}
68+
- "{{ (moodle_deploy_version == 'MOODLE_311_STABLE' or moodle_deploy_version == 'MOODLE_400_STABLE') | ternary(omit, '--supportemail=' + moodle_support_email) }}"
6969
ansible.builtin.command:
7070
chdir: "{{ moodle_deploy_destination }}"
7171
argv: "{{ command_args | reject('equalto', omit) | list }}"

tasks/install_php.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
# @copyright 2023 Geoffrey Bernardo van Wyk (https://geoffreyvanwyk.dev)
2121
##
2222

23+
- name: Set PHP version
24+
ansible.builtin.set_fact:
25+
php_version: "{{
26+
'8.1' if (moodle_deploy_version == 'MOODLE_402_STABLE') or (moodle_deploy_version == 'MOODLE_401_STABLE')
27+
else '8.0' if (moodle_deploy_version == 'MOODLE_400_STABLE') or (moodle_deploy_version == 'MOODLE_311_STABLE')
28+
else '7.4' }}"
29+
2330
- name: Install PHP
2431
ansible.builtin.include_role:
2532
name: geoffreyvanwyk.php

vars/main.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
# @see Understanding Variable Precedence {@link https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html#understanding-variable-precedence}
2222
##
2323

24-
php_version: "{{
25-
'8.1' if (moodle_deploy_version == 'MOODLE_402_STABLE') or (moodle_deploy_version == 'MOODLE_401_STABLE')
26-
else '8.0' if (moodle_deploy_version == 'MOODLE_400_STABLE') or (moodle_deploy_version == 'MOODLE_311_STABLE')
27-
else '7.4' }}"
28-
2924
moodle_instance: "{{ moodle_web_domain + ('' if moodle_web_path == '' else '-' + moodle_web_path) }}"
3025

3126
moodle_cfg_wwwroot: "{{ moodle_web_protocol }}://{{ moodle_web_domain }}/{{ moodle_web_path }}"

0 commit comments

Comments
 (0)