Skip to content

Commit 3ceae20

Browse files
committed
load default PHP versions from dokuwiki repo
We do not want to hardcode the default versions for stable and master, instead we pull them from the testLinux.yaml workflow. This way we have a canonical place to define those versions.
1 parent 7feaefa commit 3ceae20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+17571
-11
lines changed

.github/actions/dokuenv/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ outputs:
1717
maxphp:
1818
description: 'The maximum PHP version compatible with the extension, if set. Otherwise empty.'
1919
runs:
20-
using: 'node16'
20+
using: 'node20'
2121
main: 'index.js'

.github/actions/phpmatrix/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ outputs:
88
minphp:
99
description: 'The minimum PHP version supported'
1010
runs:
11-
using: 'node16'
11+
using: 'node20'
1212
main: 'index.js'

.github/actions/phpmatrix/index.js

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const core = require('@actions/core');
2+
const yaml = require('js-yaml');
23
const dwUtils = require('../dokuwikiUtils');
34

45
/**
@@ -15,16 +16,31 @@ function toNumberString(num) {
1516
}
1617
}
1718

18-
async function main() {
19-
/**
20-
* these are the default versions for each branch
21-
* @fixme ideally we would load this from the dokuwiki repo
22-
*/
19+
/**
20+
* Load the PHP versions to test against by default from the dokuwiki repo
21+
*
22+
* @returns {Promise<{stable: *[], master: *[]}>}
23+
*/
24+
async function fetchPHPVersions() {
2325
const defaults = {
24-
stable: [7.2, 7.3, 7.4, 8.0, 8.1, 8.2],
25-
master: [7.4, 8.0, 8.1, 8.2],
26+
stable: [],
27+
master: [],
2628
}
2729

30+
for (const [branch, ] of Object.entries(defaults)) {
31+
const url = `https://raw.githubusercontent.com/dokuwiki/dokuwiki/${branch}/.github/workflows/testLinux.yml`
32+
const response = await fetch(url);
33+
const body = await response.text()
34+
const doc = yaml.load(body);
35+
defaults[branch] = doc.jobs.run.strategy.matrix['php-versions'];
36+
}
37+
console.log('Default PHP Versions:', defaults);
38+
return defaults;
39+
}
40+
41+
async function main() {
42+
const defaults = await fetchPHPVersions();
43+
2844
const matrix = {
2945
stable: {
3046
'dokuwiki-branch': ['stable'],

node_modules/.bin/js-yaml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/argparse/CHANGELOG.md

Lines changed: 216 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)