From 51e4b29524e1435ec0ae26505b4364f1db04f057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ewilan=20Rivi=C3=A8re?= Date: Thu, 30 May 2024 17:35:09 +0200 Subject: [PATCH] chore: Update .github/workflows/codecov.yml to include scout command The .github/workflows/codecov.yml file was modified to include the scout command. This change adds the scout command to the workflow, allowing for the execution of the scout tool during the CI/CD process. The scout command is now run after setting up PHP, providing better code scanning and analysis capabilities. --- .github/workflows/run-tests.yml | 9 +++++++++ tests/FileListCommandTest.php | 16 +++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index f70586a..71267be 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -33,12 +33,21 @@ jobs: override: true - name: Bash commands + if: runner.os == 'Linux' run: | git clone https://github.com/ewilan-riviere/scout.git cd scout cargo build --release cp target/release/scout /usr/local/bin + - name: Powershell commands + if: runner.os == 'Windows' + run: | + git clone https://github.com/ewilan-riviere/scout.git + cd scout + cargo build --release + set PATH=%PATH%;C:\scout\target\release + - name: Setup PHP uses: shivammathur/setup-php@v2 with: diff --git a/tests/FileListCommandTest.php b/tests/FileListCommandTest.php index adec2c9..797e907 100644 --- a/tests/FileListCommandTest.php +++ b/tests/FileListCommandTest.php @@ -10,13 +10,6 @@ expect($list->getFiles())->toBeArray(); expect($list->getFiles())->toHaveCount(7); - $list = FileList::make(PATH_TO_SCAN) - ->withScout('/usr/local/bin/scout') - ->run(); - - expect($list->getFiles())->toBeArray(); - expect($list->getFiles())->toHaveCount(7); - expect(fn () => FileList::make('non-existent-path') ->withScout() ->throwOnError() @@ -24,6 +17,15 @@ )->toThrow(Exception::class); }); +it('can list files with scout with path', function () { + $list = FileList::make(PATH_TO_SCAN) + ->withScout('/usr/local/bin/scout') + ->run(); + + expect($list->getFiles())->toBeArray(); + expect($list->getFiles())->toHaveCount(7); +})->skip(PHP_OS_FAMILY === 'Windows', 'Binary path is unix here'); + it('can list files with find', function () { $list = FileList::make(PATH_TO_SCAN) ->noMemoryLimit()