diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d38486..200af40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,15 +3,18 @@ on: push: branches: - main +env: + SYMFONY_DEPRECATIONS_HELPER: disabled name: CI jobs: tests: runs-on: ubuntu-latest strategy: matrix: - php-versions: ['8.1', '8.2'] + php-versions: ['8.3'] container: - image: ghcr.io/city-of-helsinki/drupal-php-docker:${{ matrix.php-versions }}-alpine + image: ghcr.io/city-of-helsinki/drupal-web:${{ matrix.php-versions }} + options: --user 1001 services: db: @@ -25,9 +28,7 @@ jobs: - 3306:3306 steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 1 + - uses: actions/checkout@v4 - name: Install required composer dependencies run: composer install @@ -42,6 +43,8 @@ jobs: run: vendor/bin/phpunit -c tests/phpunit.xml tests/ - - name: Upload codecov - run: codecov + - uses: codecov/codecov-action@v5 + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/src/Drush/Commands/UpdateDrushCommands.php b/src/Drush/Commands/UpdateDrushCommands.php index b4dd6f6..49ad913 100644 --- a/src/Drush/Commands/UpdateDrushCommands.php +++ b/src/Drush/Commands/UpdateDrushCommands.php @@ -126,41 +126,11 @@ private function parseOptions(array $options, string $root) : UpdateOptions { return new UpdateOptions( ignoreFiles: $ignoreFiles, branch: $options['branch'], - updateExternalPackages: $options['update-external-packages'], selfUpdate: $options['self-update'], runMigrations: $options['run-migrations'], ); } - /** - * Updates the dependencies. - * - * @param \DrupalTools\Update\UpdateOptions $options - * The update options. - * @param string $root - * The root directory. - * - * @return self - * The self. - */ - private function updateExternalPackages(UpdateOptions $options, string $root) : self { - if (!$options->updateExternalPackages) { - return $this; - } - $this->style->note('Checking external packages ...'); - - // Update druidfi/tools only if the package exists. - if ($this->filesystem->exists($root . '/tools')) { - $this->processManager()->process([ - 'make', - 'self-update', - ])->run(function (string $type, ?string $output) : void { - $this->style->write($output); - }); - } - return $this; - } - /** * Checks if the self-package needs to be updated. * @@ -257,11 +227,13 @@ private function updateDefaultFiles(UpdateOptions $options) : self { 'phpcs.xml.dist', 'phpunit.xml.dist', 'phpunit.platform.xml', - 'tools/make/override.mk', - 'tools/make/project/install.mk', - 'tools/make/project/git.mk', - 'tools/make/project/theme.mk', - 'tools/make/project/db-sync.sh', + 'Makefile', + 'tools/make/composer.mk', + 'tools/make/docker.mk', + 'tools/make/drupal.mk', + 'tools/make/git.mk', + 'tools/make/qa.mk', + 'tools/make/theme.mk', 'tools/commit-msg', '.sonarcloud.properties', '.github/pull_request_template.md', @@ -325,7 +297,7 @@ public function updatePlatform(array $options = self::DEFAULT_OPTIONS) : int { return DrushCommands::EXIT_FAILURE_WITH_CLARITY; } - $this->updateExternalPackages($options, $root) + $this ->runUpdateHooks($options, $root) ->updateDefaultFiles($options) ->addDefaultFiles($options); diff --git a/src/Update/migrations.php b/src/Update/migrations.php index bd4ee0f..7ca64dc 100644 --- a/src/Update/migrations.php +++ b/src/Update/migrations.php @@ -287,3 +287,15 @@ function drupal_tools_update_14() : UpdateResult { 'Added phpstan/extension-installer to allow-plugins', ]); } + +/** + * Remove druidfi/tools. + */ +function drupal_tools_update_15(UpdateOptions $options, FileManager $fileManager): UpdateResult { + $fileManager->removeFiles($options, [ + 'tools', + ]); + return new UpdateResult([ + 'Removed tools/ folder', + ]); +} diff --git a/tests/src/Kernel/CheckPackageVersionsCommandsTest.php b/tests/src/Kernel/CheckPackageVersionsCommandsTest.php index 57861ce..4c88acf 100644 --- a/tests/src/Kernel/CheckPackageVersionsCommandsTest.php +++ b/tests/src/Kernel/CheckPackageVersionsCommandsTest.php @@ -6,7 +6,6 @@ use Consolidation\OutputFormatters\StructuredData\RowsOfFields; use Drupal\KernelTests\KernelTestBase; -use Drupal\Tests\helfi_api_base\Traits\ApiTestTrait; use DrupalTools\Drush\Commands\PackageScannerDrushCommands; use DrupalTools\OutputFormatters\MarkdownTableFormatter; use DrupalTools\Package\ComposerOutdatedProcess; @@ -25,14 +24,8 @@ */ final class CheckPackageVersionsCommandsTest extends KernelTestBase { - use ApiTestTrait; use ProphecyTrait; - /** - * {@inheritdoc} - */ - protected static $modules = ['helfi_api_base']; - /** * Initialized a dummy Drush container. *