Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH Update reference to supported modules data #29

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep the schedule? If an auto-tag fails on merge (happens very occasionally) the cron will pick it up

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standardiser will add dispatch-ci to this module when it's next run. This is the way we do this for all repos that use standard CI.

- 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",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supported-modules needs 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
Loading