From e057be4629ab5d46c8b56c519ce475cde8570458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 2 Sep 2024 22:51:02 +0200 Subject: [PATCH] ci: add Windows (#11) --- .github/workflows/ci.yml | 11 +++++++---- src/Command/LinkCommand.php | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a8926c..ff65f2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php }} + php-version: '8.3' tools: composer coverage: none - run: composer install @@ -34,21 +34,24 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php }} + php-version: '8.3' tools: composer coverage: none - run: composer install - run: composer phpstan functional: name: Functional tests - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] steps: - name: Checkout uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php }} + php-version: '8.3' tools: composer coverage: none - run: composer install diff --git a/src/Command/LinkCommand.php b/src/Command/LinkCommand.php index 7f3e3e9..5c43ef3 100644 --- a/src/Command/LinkCommand.php +++ b/src/Command/LinkCommand.php @@ -72,7 +72,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $config = Config::createFromJson($monoRepositoryComposer, $baseDir); $composerFile = $this->getComposerFileAtPath($wd); $repositories = $this->buildRepositories($config->composerFiles); - $composer = static::$fileContents[$composerFile] = $this->readJsonFile($composerFile); + $composer = self::$fileContents[$composerFile] = $this->readJsonFile($composerFile); $filesToWrite = []; $revert = []; @@ -172,8 +172,8 @@ private function mapDependencies(array $composer, array $composerFiles, string $ } yield $package; - - static::$fileContents[$composerFiles[$package]] = $this->readJsonFile($composerFiles[$package]); + + self::$fileContents[$composerFiles[$package]] = $this->readJsonFile($composerFiles[$package]); foreach ($this->mapDependencies(static::$fileContents[$composerFiles[$package]], $composerFiles, $key) as $package) { yield $package; }