From d286bfb8f07b2025fde369e635bdb63efc2f2060 Mon Sep 17 00:00:00 2001 From: drtheuns Date: Wed, 15 Jan 2020 21:44:51 +0100 Subject: [PATCH] Set up semaphore CI with different PHP versions (#6) Setup CI --- .semaphore/semaphore.yml | 27 ++++++++++++++++----------- src/Apitizer/QueryBuilder.php | 2 +- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index cbed963..cbb5cc0 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -1,14 +1,14 @@ version: v1.0 -name: Initial Pipeline +name: Test pipeline agent: machine: type: e1-standard-2 os_image: ubuntu1804 blocks: - - name: Checkout code + - name: Setup task: jobs: - - name: setup + - name: composer setup commands: - checkout - cache restore @@ -25,23 +25,28 @@ blocks: value: postgres - name: DB_PASSWORD value: postgres + prologue: + commands: + - checkout + - cache restore jobs: - name: run tests commands: - - checkout - - cache restore - sem-service start postgres - createdb -U postgres -h 127.0.0.1 apitizer_testing - echo 'Running tests' + - php --version - composer test - - name: Extra + - name: Checks task: + prologue: + commands: + - checkout + - cache restore jobs: - - name: security check + - name: security commands: - - checkout - - cache restore - - 'git clone https://github.com/sensiolabs/security-checker.git' + - git clone https://github.com/sensiolabs/security-checker.git - cd security-checker - composer install - - 'php security-checker security:check ../composer.lock' + - php security-checker security:check ../composer.lock diff --git a/src/Apitizer/QueryBuilder.php b/src/Apitizer/QueryBuilder.php index 2930f74..306c09d 100644 --- a/src/Apitizer/QueryBuilder.php +++ b/src/Apitizer/QueryBuilder.php @@ -400,7 +400,7 @@ protected function validateRequestInput(ParsedInput $unvalidatedInput): FetchSpe $validated = new FetchSpec( $this->getValidatedFields($unvalidatedInput->fields, $this->getFields()), $this->getValidatedSorting($unvalidatedInput->sorts, $this->getSorts()), - $this->getValidatedFilters($unvalidatedInput->filters, $this->getFilters()), + $this->getValidatedFilters($unvalidatedInput->filters, $this->getFilters()) ); return $validated;