Skip to content

Commit

Permalink
ENH Update reference to supported modules data (#29)
Browse files Browse the repository at this point in the history
* ENH Update reference to supported modules data

* MNT Use regular CI

Required both for using a correct PHP version and making sure patches
get auto-tagged
  • Loading branch information
GuySartorelli authored May 9, 2024
1 parent 6facb4e commit 5e11d7a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 31 deletions.
26 changes: 2 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,8 @@ on:
push:
pull_request:
workflow_dispatch:
# Every Tuesday at 2:00pm UTC
schedule:
- cron: '0 14 * * 2'

jobs:
build:
ci:
name: CI
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2.4.2

- name: Install PHP
uses: shivammathur/setup-php@3eda58347216592f618bb1dff277810b6698e4ca # v2.19.1
with:
php-version: 7.4
tools: composer:v2

- name: Composer install
run: composer install

- name: PHPUnit
run: vendor/bin/phpunit

- name: PHP linting
run: vendor/bin/phpcs
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
}
],
"require": {
"php": "^7.4 || ^8.1",
"php": "^8.1",
"silverstripe/supported-modules": "dev-main",
"symfony/console": "^4 || ^5 || ^6",
"symfony/process": "^4 || ^5 || ^6",
"symfony/yaml": "^4 || ^5 || ^6",
Expand Down
14 changes: 8 additions & 6 deletions src/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use RuntimeException;
use LogicException;
use Symfony\Component\Console\Formatter\OutputFormatter;
use SilverStripe\SupportedModules\MetaData;

class Translator
{
Expand Down Expand Up @@ -150,15 +151,16 @@ private function getFrameworkMajor(): string

private function setModulePaths(): void
{
$client = new Client();
$cmsMajor = $this->getFrameworkMajor();
$url = "https://raw.githubusercontent.com/silverstripe/supported-modules/$cmsMajor/modules.json";
$body = (string) $client->request('GET', $url)->getBody();
$modules = MetaData::removeReposNotInCmsMajor(
MetaData::getAllRepositoryMetaData()[MetaData::CATEGORY_SUPPORTED],
$cmsMajor
);
$supportedVendors = [];
$supportedModules = [];
foreach ($this->jsonDecode($body) as $data) {
$supportedModules[] = $data['composer'];
$supportedVendors[] = explode('/', $data['composer'])[0];
foreach ($modules as $module) {
$supportedModules[] = $module['packagist'];
$supportedVendors[] = explode('/', $module['packagist'])[0];
}
$vendorDir = dirname(dirname(dirname(__DIR__)));
foreach ($this->scandir($vendorDir) as $vendor) {
Expand Down

0 comments on commit 5e11d7a

Please sign in to comment.