Scrutinizer: build and test in a subdirectory

397 views Asked by At

I have a repo with both front and backend application and i want to use scrutinizer to build and test my backend (PHP) application. How can i tell (or configure) scrutinizer to build and test my application in this subdirectory?

Here is the basic structure of my repo:

root
|__Api
|  |_src
|  |_composer.json
|  |_phpspec.yml
|  |_ ...
|
|__Front
   |_index.html
   |_api.php
   |_ ...

I would like to run composer install and phpspec in the Api directory.

Thank you, JM

2

There are 2 answers

1
Alex Blex On BEST ANSWER

Change the directory in your .scrutinizer.yml:

build:
    project_setup:
        before:
            - "cd Api"

https://scrutinizer-ci.com/docs/configuration/build#dependencies-project-setup

If you want to exclude frontend files from analysis, filter them out, e.g:

filter:
    paths: [Api/src/*]

https://scrutinizer-ci.com/docs/reviews/excluding_files_from_analysis

0
Jake N On

This approach worked for me

build:
    root_path: 'app/'

But project_setup did not work for me.