Skip to content

Commit

Permalink
chore: Update .github/workflows/codecov.yml to include scout command
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ewilan-riviere committed May 30, 2024
1 parent b0df96d commit 51e4b29
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 9 additions & 7 deletions tests/FileListCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,22 @@
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()
->run()
)->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()
Expand Down

0 comments on commit 51e4b29

Please sign in to comment.