Skip to content

Commit

Permalink
refactor pipelines and readme for plugin_compatibility.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Glutamat42 committed Dec 17, 2024
1 parent 2c7d183 commit 7ff3eac
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 18 deletions.
45 changes: 37 additions & 8 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,39 @@ on:
- '**'

jobs:
define-matrix:
runs-on: ubuntu-latest

outputs:
include_list: ${{ steps.include_list.outputs.include_list }}

steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Define matrix
id: include_list
run: |
# Generates a json array with include entries for all possible combinations of PHP, Moodle branch and database
include_str="["
first_entry=true
for i in $(cat plugin_compatibility.json | jq -c '.[]'); do
moodle=$(echo "$i" | jq -r '.moodle')
for php in $(echo "$i" | jq -r '.PHP[]'); do
for database in pgsql mariadb; do
if [ "$first_entry" = true ]; then
first_entry=false
else
include_str="$include_str,"
fi
next_entry="{\"php\": \"$php\", \"moodle-branch\": \"$moodle\", \"database\": \"$database\", \"experimental\": false}"
include_str="$include_str$next_entry"
done
done
done
include_str="$include_str]"
echo "include_list=$include_str" >> "$GITHUB_OUTPUT"
test:
runs-on: ubuntu-22.04

Expand Down Expand Up @@ -38,15 +71,11 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3']
moodle-branch: ['MOODLE_404_STABLE', 'MOODLE_405_STABLE']
php: ['8.3']
moodle-branch: ['main']
database: [pgsql, mariadb]
experimental: [false]
include:
- php: '8.3'
moodle-branch: 'main'
database: mariadb
experimental: true
experimental: [true]
include: ${{ fromJSON(needs.define-matrix.outputs.include_list) }}

continue-on-error: ${{ matrix.experimental }}

Expand Down
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,10 @@ Ist das Haupt-Plugin nicht installiert wird die durch dieses Plugin implementier
| local_adler | ~3.0.0 |



## Kompatibilität
## Kompabilität
Folgende Versionen werden unterstützt (mit mariadb und postresql getestet):

| Moodle Branch | PHP Version |
|-------------------------|-------------|
| MOODLE_404_STABLE | 8.1 |
| MOODLE_404_STABLE | 8.2 |
| MOODLE_404_STABLE | 8.3 |
| MOODLE_405_STABLE (LTS) | 8.1 |
| MOODLE_405_STABLE (LTS) | 8.2 |
| MOODLE_405_STABLE (LTS) | 8.3 |
siehe [plugin_compatibility.json](plugin_compatibility.json)

## Installation
1. Dieses Plugin benötigt das Plugin `local_adler` als Abhängigkeit. Beide müssen zeitgleich installiert werden (= vor dem upgrade in die Moodle-Installation entpackt sein). Installation siehe `local_adler`
Expand Down
18 changes: 18 additions & 0 deletions plugin_compatibility.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"moodle": "MOODLE_404_STABLE",
"PHP": [
"8.1",
"8.2",
"8.3"
]
},
{
"moodle": "MOODLE_405_STABLE",
"PHP": [
"8.1",
"8.2",
"8.3"
]
}
]

0 comments on commit 7ff3eac

Please sign in to comment.